auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolParameters param = new org.ovirt.engine.core.common.action.AddVmPoolParameters ( vmPools , testVm , VM_COUNT ) ; param.setStorageDomainId ( firstStorageDomainId ) ; org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolParameters > ( param , org.ovirt.engine.core.bll.context.CommandContext.createContext ( param.getSessionId ( ) ) ) { @ java.lang.Override protected void initUser ( ) { } @ java.lang.Override protected void initTemplate ( ) { } } ) ; return command ; }

Target:
protected org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolParameters param = new org.ovirt.engine.core.common.action.AddVmPoolParameters ( vmPools , testVm , VM_COUNT ) ; param.setStorageDomainId ( firstStorageDomainId ) ; return org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.AddVmPoolCommand ( param , org.ovirt.engine.core.bll.context.CommandContext.createContext ( param.getSessionId ( ) ) ) ) ; }
Source:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }
Source:
protected void EndWithFailure ( ) { if ( ( getMoveOrCopyImageOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.UnLockImage ( ) ; if ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } RevertTasks ( ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.MarkImageAsIllegal ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.setSucceeded ( true ) ; }

Target:
protected void EndWithFailure ( ) { if ( ( getMoveOrCopyImageOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.UnLockImage ( ) ; if ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } RevertTasks ( ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.MarkImageAsIllegal ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.setSucceeded ( true ) ; }
Source:
public java.lang.String retrieveFromHttpSession ( java.lang.String key ) { javax.servlet.http.HttpServletRequest request = this . getThreadLocalRequest ( ) ; javax.servlet.http.HttpSession session = request.getSession ( ) ; java.lang.Object value = session.getAttribute ( ( ( org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.UI_PREFIX ) + key ) ) ; java.lang.String result = null ; if ( value instanceof java.lang.String ) { result = ( ( java.lang.String ) ( value ) ) ; } else { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.error ( "Retrieving non string value from session" ) ; } return result ; }

Target:
public java.lang.String retrieveFromHttpSession ( java.lang.String key ) { javax.servlet.http.HttpServletRequest request = this . getThreadLocalRequest ( ) ; javax.servlet.http.HttpSession session = request.getSession ( ) ; java.lang.Object value = session.getAttribute ( ( ( org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.UI_PREFIX ) + key ) ) ; java.lang.String result = null ; if ( value instanceof java.lang.String ) { result = ( ( java.lang.String ) ( value ) ) ; } else if ( value != null ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.error ( "Retrieving non string value from session" ) ; } return result ; }
Source:
private boolean isPlugCommandAvailable ( boolean plug ) { return ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) && ( isPlugAvailableByDisks ( plug ) ) ) && ( ( isVmDown ( ) ) || ( ( isHotPlugAvailable ( ) ) && ( getIsDiskHotPlugSupported ( ) ) ) ) ; }

Target:
private boolean isPlugCommandAvailable ( boolean plug ) { return ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) && ( isPlugAvailableByDisks ( plug ) ) ) && ( ( isVmDown ( ) ) || ( isHotPlugAvailable ( ) ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( GUIDS [ 0 ] , true ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( GUIDS [ 0 ] , true ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setReturnValue ( getUserRequestForStorageDomainRepoFileList ( ) ) ; } catch ( java.lang.Exception e ) { java.lang.String message = java.util.Optional.ofNullable ( e.getCause ( ) ) . map ( java.lang.Throwable :: getMessage ) . orElse ( "" ) ; log.error ( "Failed to retrieve image list: {}" , message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setExceptionString ( message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setSucceeded ( false ) ; } }

Target:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setReturnValue ( getUserRequestForStorageDomainRepoFileList ( ) ) ; } catch ( java.lang.Exception e ) { java.lang.String message = java.util.Optional.ofNullable ( e.getCause ( ) ) . orElse ( e ) . getMessage ( ) ; log.error ( "Failed to retrieve image list: {}" , message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setExceptionString ( message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setSucceeded ( false ) ; } }
Source:
public static boolean validHostname ( java.lang.String address ) { if ( ( address == null ) || ( address.trim ( ) . isEmpty ( ) ) ) { return false ; } return sun.net.util.IPAddressUtil.isIPv6LiteralAddress ( address ) ? org.ovirt.engine.core.common.utils.ValidationUtils.isValidIpv6Address ( address ) : org.ovirt.engine.core.common.utils.ValidationUtils.isValidIpAddressOrHostname ( address ) ; }

Target:
public static boolean validHostname ( java.lang.String address ) { if ( ( address == null ) || ( address.trim ( ) . isEmpty ( ) ) ) { return false ; } return ( org.ovirt.engine.core.common.utils.ValidationUtils.isValidIpAddressOrHostname ( address ) ) || ( org.ovirt.engine.core.common.utils.ValidationUtils.isValidIpv6Address ( address ) ) ; }
Source:
private void addLimit ( org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage , java.lang.String id , org.ovirt.engine.api.model.QuotaStorageLimits limits , org.ovirt.engine.core.common.businessentities.Quota quota ) { org.ovirt.engine.api.model.QuotaStorageLimit limit = new org.ovirt.engine.api.model.QuotaStorageLimit ( ) ; limit.setId ( id ) ; limits.getQuotaStorageLimits ( ) . add ( addLinks ( map ( quota , limit ) ) ) ; }

Target:
private void addLimit ( java.lang.String id , org.ovirt.engine.api.model.QuotaStorageLimits limits , org.ovirt.engine.core.common.businessentities.Quota quota ) { org.ovirt.engine.api.model.QuotaStorageLimit limit = new org.ovirt.engine.api.model.QuotaStorageLimit ( ) ; limit.setId ( id ) ; limits.getQuotaStorageLimits ( ) . add ( addLinks ( map ( quota , limit ) ) ) ; }
Source:
public final boolean IsUpdateValid ( java.lang.Object source , java.lang.Object destination , java.lang.Enum < ? > status ) { if ( ( source.getClass ( ) ) != ( destination.getClass ( ) ) ) { return false ; } for ( java.lang.String fieldName : org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( source , destination ) ) { if ( ! ( IsFieldUpdatable ( status , fieldName , null ) ) ) { org.ovirt.engine.core.utils.ObjectIdentityChecker.log.warn ( java.lang.String.format ( "ObjectIdentityChecker.IsUpdateValid:: Not updatable field '%1$s' was updated" , fieldName ) ) ; return false ; } } return true ; }

Target:
public final boolean IsUpdateValid ( java.lang.Object source , java.lang.Object destination , java.lang.Enum < ? > status ) { return IsUpdateValid ( source , destination , status , false ) ; }
Source:
public void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.EditVnicProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.EditVnicProfileModel ( this , getSelectedItem ( ) , getEntity ( ) . getDataCenterId ( ) ) ; setWindow ( model ) ; initProfileNetwork ( model ) ; }

Target:
public void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.EditVnicProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.EditVnicProfileModel ( this , getSelectedItem ( ) , getEntity ( ) . getDataCenterId ( ) ) ; setWindow ( model ) ; }
Source:
protected void initMtu ( ) { getHasMtu ( ) . setEntity ( ( ( getNetwork ( ) . getMtu ( ) ) != 0 ) ) ; getMtu ( ) . setEntity ( ( ( getNetwork ( ) . getMtu ( ) ) != 0 ? java.lang.String.valueOf ( getNetwork ( ) . getMtu ( ) ) : null ) ) ; }

Target:
protected void initMtu ( ) { getHasMtu ( ) . setEntity ( ( ( getNetwork ( ) . getMtu ( ) ) != 0 ) ) ; getMtu ( ) . setEntity ( ( ( getNetwork ( ) . getMtu ( ) ) != 0 ? getNetwork ( ) . getMtu ( ) : null ) ) ; }
Source:
protected void changeStorageDomainStatusInTransaction ( final org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map , final org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > ( ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map ) ; map.setStatus ( status ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; }

Target:
protected void changeStorageDomainStatusInTransaction ( final org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map , final org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , final org.ovirt.engine.core.bll.context.CompensationContext context ) { executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > ( ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { context.snapshotEntityStatus ( map ) ; map.setStatus ( status ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; context.stateChanged ( ) ; return null ; } } ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStatsForDomain ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.utils.linq.LinqUtils.first ( org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommand.getAllRunningVdssInPool ( ) ) ; return runVdsCommand ( VDSCommandType.GetStorageDomainStats , new org.ovirt.engine.core.common.vdscommands.GetStorageDomainStatsVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStatsForDomain ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.utils.linq.LinqUtils.first ( org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommand.getAllRunningVdssInPool ( ) ) ; if ( vds == null ) { return null ; } return runVdsCommand ( VDSCommandType.GetStorageDomainStats , new org.ovirt.engine.core.common.vdscommands.GetStorageDomainStatsVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; }
Source:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getClusterList ( aQuery , true ) ; }
Source:
public void doFilter ( final javax.servlet.ServletRequest request , final javax.servlet.ServletResponse response , final javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.util.Locale locale = determineLocale ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ; request.setAttribute ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , locale ) ; setCookie ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) , request.getServletContext ( ) , locale ) ; chain.doFilter ( request , response ) ; }

Target:
public void doFilter ( final javax.servlet.ServletRequest request , final javax.servlet.ServletResponse response , final javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.util.Locale locale = determineLocale ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ; request.setAttribute ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , locale ) ; setCookie ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) , ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) , locale ) ; chain.doFilter ( request , response ) ; }
Source:
private boolean prestartVm ( org.ovirt.engine.core.compat.Guid vmGuid ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( vmGuid ) ) { org.ovirt.engine.core.common.businessentities.VM vmToPrestart = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmGuid ) ; return runVmAsStateless ( vmToPrestart ) ; } return false ; }

Target:
private boolean prestartVm ( org.ovirt.engine.core.compat.Guid vmGuid ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( vmGuid , new java.util.ArrayList < java.lang.String > ( ) ) ) { org.ovirt.engine.core.common.businessentities.VM vmToPrestart = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmGuid ) ; return runVmAsStateless ( vmToPrestart ) ; } return false ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( getVmPoolId ( ) ) == null ? null : getVmPoolId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.VmPool , org.ovirt.engine.core.bll.VmPoolCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVmPoolId ( ) , org.ovirt.engine.core.common.VdcObjectType.VmPool , org.ovirt.engine.core.bll.VmPoolCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { super . onLogin ( loginModel ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { commonModelProvider.get ( ) . updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; displayBrowserCompatibilityWarning ( ) ; }

Target:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { super . onLogin ( loginModel ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { commonModelProvider.get ( ) . updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }
Source:
public void onSuccessAudit ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 2 ) ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }

Target:
public void onSuccessAudit ( ) { mockExecutor ( true ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 2 ) ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }
Source:
protected org.ovirt.engine.api.model.DiskSnapshot postPopulate ( org.ovirt.engine.api.model.DiskSnapshot model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) ) ; model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ) ; model.setLunStorage ( null ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.DiskSnapshot postPopulate ( org.ovirt.engine.api.model.DiskSnapshot model ) { model.setFormat ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskFormat.class ) ) ; model.setInterface ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskInterface.class ) ) ; model.setSgio ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ScsiGenericIO.class ) ) ; model.setStatus ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.DiskStatus.class ) ) ; model.setLunStorage ( null ) ; return model ; }
Source:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setVmSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; command.executeVmCommand ( ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getVmSnapshotId ( ) ) == null ) ) ; }

Target:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setVmSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; command.executeVmCommand ( ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getVmSnapshotId ( ) ) == null ) ) ; }
Source:
public void testFetchSpecificQuotaUsageForGlobalCluster ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertEquals ( true , ( ( quotaClusterList.size ( ) ) == 2 ) ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; }

Target:
public void testFetchSpecificQuotaUsageForGlobalCluster ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertEquals ( 2 , quotaClusterList.size ( ) ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; }
Source:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( cinderDisks , vmSnapshotId , diskInfoDestinationMap ) ; createParams.setParentHasTasks ( ( ! ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) ) ) ; return withRootCommandInfo ( createParams , org.ovirt.engine.core.bll.AddVmTemplateCommand.getActionType ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( cinderDisks , vmSnapshotId , diskInfoDestinationMap ) ; return withRootCommandInfo ( createParams , org.ovirt.engine.core.bll.AddVmTemplateCommand.getActionType ( ) ) ; }
Source:
public javax.net.ssl.TrustManager [ ] getTustManagers ( ) { try { java.security.KeyStore keyStore = java.security.KeyStore.getInstance ( "JKS" ) ; keyStore.load ( this . trustStream , this . pass.toCharArray ( ) ) ; javax.net.ssl.TrustManagerFactory tmf = javax.net.ssl.TrustManagerFactory.getInstance ( javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm ( ) ) ; tmf.init ( keyStore ) ; return tmf.getTrustManagers ( ) ; } catch ( java.security.NoSuchAlgorithmException | java.io.IOException | java.security.KeyStoreException | java.security.cert.CertificateException ex ) { throw new java.lang.RuntimeException ( ex ) ; } }

Target:
public javax.net.ssl.TrustManager [ ] getTrustManagers ( ) { try { java.security.KeyStore keyStore = java.security.KeyStore.getInstance ( "JKS" ) ; keyStore.load ( this . trustStream , this . pass.toCharArray ( ) ) ; javax.net.ssl.TrustManagerFactory tmf = javax.net.ssl.TrustManagerFactory.getInstance ( javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm ( ) ) ; tmf.init ( keyStore ) ; return tmf.getTrustManagers ( ) ; } catch ( java.security.NoSuchAlgorithmException | java.io.IOException | java.security.KeyStoreException | java.security.cert.CertificateException ex ) { throw new java.lang.RuntimeException ( ex ) ; } }
Source:
private void addBondOptionIfMissing ( java.lang.String candidateOption ) { if ( ! ( pairForBondOption.containsKey ( candidateOption ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; entityModel.setEntity ( candidateOption ) ; java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > newPair = new org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( "custom" , entityModel ) ; bondOptions.add ( newPair ) ; pairForBondOption.put ( candidateOption , newPair ) ; } }

Target:
private void addBondOptionIfMissing ( java.lang.String candidateOption ) { if ( ! ( pairForBondOption.containsKey ( candidateOption ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > entityModel = new org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > ( ) ; entityModel.setEntity ( candidateOption ) ; java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > newPair = new org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > ( "custom" , entityModel ) ; bondOptions.add ( newPair ) ; pairForBondOption.put ( candidateOption , newPair ) ; } }
Source:
public static org.ovirt.engine.api.model.Bookmark map ( org.ovirt.engine.api.model.Bookmark entity , org.ovirt.engine.api.model.Bookmark template ) { org.ovirt.engine.api.model.Bookmark model = ( template != null ) ? template : new org.ovirt.engine.api.model.Bookmark ( ) ; model.setId ( entity.getbookmark_id ( ) . toString ( ) ) ; model.setName ( entity.getbookmark_name ( ) ) ; model.setValue ( entity.getbookmark_value ( ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Bookmark map ( org.ovirt.engine.api.model.Bookmark entity , org.ovirt.engine.api.model.Bookmark template ) { org.ovirt.engine.api.model.Bookmark model = ( template != null ) ? template : new org.ovirt.engine.api.model.Bookmark ( ) ; model.setId ( entity.getId ( ) . toString ( ) ) ; model.setName ( entity.getName ( ) ) ; model.setValue ( entity.getValue ( ) ) ; return model ; }
Source:
public float nextFloat ( float f , boolean inclusive ) { if ( f <= 0.0F ) { throw new java.lang.IllegalArgumentException ( "f must be greater than 0!" ) ; } float rand = super . nextFloat ( ) ; if ( ! inclusive ) { while ( rand == 1.0F ) { rand = super . nextFloat ( ) ; } } return rand * f ; }

Target:
public float nextFloat ( float f , boolean inclusive ) { if ( f <= 0.0F ) { throw new java.lang.IllegalArgumentException ( "f must be greater than 0!" ) ; } float rand = nextFloat ( ) ; if ( ! inclusive ) { while ( rand == 1.0F ) { rand = nextFloat ( ) ; } } return rand * f ; }
Source:
public static void initNicHotplugSupportMap ( ) { 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.nicHotplugSupportMap = ( ( java.util.Map < org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > , java.lang.Boolean > ) ( ( ( 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.GetNicHotplugSupportMap ) , callback ) ; }

Target:
public static void initNicHotplugSupportMap ( ) { 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.nicHotplugSupportMap = ( ( 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.GetNicHotplugSupportMap ) , callback ) ; }
Source:
public void testValidateWithEmptySnapshotGuid ( ) { cmd.getParameters ( ) . setDstSnapshotId ( Guid.Empty ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . updateVmDisksFromDb ( ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( cmd ) . getSnapshotDao ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID ) ; }

Target:
public void testValidateWithEmptySnapshotGuid ( ) { cmd.getParameters ( ) . setDstSnapshotId ( Guid.Empty ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID ) ; }
Source:
public void testDisksUsagesWithNullEntry ( ) { java.lang.Object [ ] disksUsages = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.initDisksUsageData ( ) ; disksUsages [ 1 ] = null ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksUsage ( disksUsages ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.validateDisksUsagesList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVmStatistics ( ) , disksUsages , xml ) ; }

Target:
public void testDisksUsagesWithNullEntry ( ) { java.lang.Object [ ] disksUsages = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.initDisksUsageData ( ) ; disksUsages [ 1 ] = null ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDisksUsage ( disksUsages ) ; validateDisksUsagesList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.getVmStatistics ( ) , disksUsages , xml ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.storage_domains storage = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_domains > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }

Target:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VdcOption other = ( ( org.ovirt.engine.core.common.businessentities.VdcOption ) ( obj ) ) ; return ( java.util.Objects.equals ( name , other.name ) ) && ( java.util.Objects.equals ( value , other.value ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VdcOption ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VdcOption other = ( ( org.ovirt.engine.core.common.businessentities.VdcOption ) ( obj ) ) ; return ( java.util.Objects.equals ( name , other.name ) ) && ( java.util.Objects.equals ( value , other.value ) ) ; }
Source:
public void validateFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForUpdate ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForUpdate ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
private void initSpmPriorities1 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; } } ) ) ; }

Target:
private void initSpmPriorities1 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; } } ) ) ; }
Source:
protected boolean canDoAction ( ) { Q validator = getProfileValidator ( ) ; return ( ( ( ( validate ( validator.profileIsSet ( ) ) ) && ( validate ( validator.profileExists ( ) ) ) ) && ( validate ( validator.profileNameNotUsed ( ) ) ) ) && ( validate ( validator.parentEntityNotChanged ( ) ) ) ) && ( validate ( validator.qosExistsOrNull ( ) ) ) ; }

Target:
protected boolean validate ( ) { Q validator = getProfileValidator ( ) ; return ( ( ( ( validate ( validator.profileIsSet ( ) ) ) && ( validate ( validator.profileExists ( ) ) ) ) && ( validate ( validator.profileNameNotUsed ( ) ) ) ) && ( validate ( validator.parentEntityNotChanged ( ) ) ) ) && ( validate ( validator.qosExistsOrNull ( ) ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network FindNetworkByName ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > items , java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.network n : items ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( n.getname ( ) , name ) ) { return n ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.Network FindNetworkByName ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > items , java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.Network n : items ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( n.getname ( ) , name ) ) { return n ; } } return null ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult changeProtocolAllowed ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_UPDATE ) . when ( ( ( ( ( getHost ( ) . getProtocol ( ) ) != ( oldHost.getProtocol ( ) ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallingOS ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult changeProtocolAllowed ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_UPDATE ) . when ( ( ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallingOS ) ) ) ) ; }
Source:
private void assertValidationWorks ( int nameLength , int numOfVms , boolean expected ) { org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation object = new org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation ( nameOfLength ( nameLength ) , numOfVms , 3 ) ; org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation spy = org.mockito.Mockito.spy ( object ) ; org.mockito.Mockito.doReturn ( true ) . when ( spy ) . isWindows ( ) ; org.junit.Assert.assertThat ( spy.validate ( null ) . getSuccess ( ) , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; }

Target:
private void assertValidationWorks ( int nameLength , int numOfVms , boolean expected ) { org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation object = new org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation ( nameOfLength ( nameLength ) , numOfVms , 3 ) ; org.ovirt.engine.ui.uicommonweb.validation.PoolNameLengthValidation spy = org.mockito.Mockito.spy ( object ) ; org.junit.Assert.assertThat ( spy.validate ( null ) . getSuccess ( ) , org.hamcrest.core.Is.is ( org.hamcrest.core.IsEqual.equalTo ( expected ) ) ) ; }
Source:
public java.lang.String createDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( new java.util.concurrent.Callable < java.lang.String > ( ) { @ java.lang.Override public java.lang.String call ( ) { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setVolumeType ( cinderDisk.getCinderVolumeType ( ) ) ; return proxy.createVolume ( cinderVolume ) ; } } ) ; }

Target:
public java.lang.String createDisk ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( ( ) -> { com.woorea.openstack.cinder.model.VolumeForCreate cinderVolume = new com.woorea.openstack.cinder.model.VolumeForCreate ( ) ; cinderVolume.setName ( cinderDisk.getDiskAlias ( ) ) ; cinderVolume.setDescription ( cinderDisk.getDiskDescription ( ) ) ; cinderVolume.setSize ( ( ( int ) ( cinderDisk.getSizeInGigabytes ( ) ) ) ) ; cinderVolume.setVolumeType ( cinderDisk.getCinderVolumeType ( ) ) ; return proxy.createVolume ( cinderVolume ) ; } ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( target ) ) ; loginModel.setENGINEUserActionGroupList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( returnValue ) ) ) ; loginModel.getENGINEUserActionGroupList ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel.ConsumeQuotaActionGroup ) ; loginModel.GetUserRoles ( loginModel ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( target ) ) ; loginModel.setENGINEUserActionGroupList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( returnValue ) ) ) ; loginModel.getENGINEUserActionGroupList ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel.ConsumeQuotaActionGroup ) ; loginModel.GetUserRoles ( loginModel ) ; }
Source:
public void networkRemovedFromBond ( ) { java.lang.String networkName = "net" ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , networkName ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; bond.setNetworkName ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNetworkRemoved ( helper , networkName ) ; assertNoBondsRemoved ( helper ) ; }

Target:
public void networkRemovedFromBond ( ) { java.lang.String networkName = "net" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , networkName ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; bond.setNetworkName ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNetworkRemoved ( helper , networkName ) ; assertNoBondsRemoved ( helper ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( model ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; storageModel.postUpdateHost ( hosts ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( model ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; storageModel.postUpdateHost ( hosts ) ; }