auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > GetNotificationEventsByType ( org.ovirt.engine.core.common.EventNotificationEntity type ) { java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > map = new java.util.HashMap < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > ( ) ; if ( org.ovirt.engine.core.common.VdcEventNotificationUtils._eventNotificationTypeMap.containsKey ( type ) ) { map.put ( type , org.ovirt.engine.core.common.VdcEventNotificationUtils._eventNotificationTypeMap.get ( type ) ) ; } return map ; }

Target:
public static java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > getNotificationEventsByType ( org.ovirt.engine.core.common.EventNotificationEntity type ) { java.util.Map < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > map = new java.util.HashMap < org.ovirt.engine.core.common.EventNotificationEntity , java.util.HashSet < org.ovirt.engine.core.common.AuditLogType > > ( ) ; if ( org.ovirt.engine.core.common.VdcEventNotificationUtils._eventNotificationTypeMap.containsKey ( type ) ) { map.put ( type , org.ovirt.engine.core.common.VdcEventNotificationUtils._eventNotificationTypeMap.get ( type ) ) ; } return map ; }
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.VmDeviceId other = ( ( org.ovirt.engine.core.common.businessentities.VmDeviceId ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( deviceId , other.deviceId ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( vmId , other.vmId ) ) ; }

Target:
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.VmDeviceId other = ( ( org.ovirt.engine.core.common.businessentities.VmDeviceId ) ( obj ) ) ; return ( java.util.Objects.equals ( deviceId , other.deviceId ) ) && ( java.util.Objects.equals ( vmId , other.vmId ) ) ; }
Source:
private void cancelImport ( ) { java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > selectedNetworks = getImportedVms ( ) . getSelectedItems ( ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > importedNetworks = getImportedVms ( ) . getItems ( ) ; getDefaultCommand ( ) . setIsExecutionAllowed ( ( ( selectedNetworks.size ( ) ) < ( importedNetworks.size ( ) ) ) ) ; }

Target:
private void cancelImport ( ) { java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > selectedVms = getImportedVmModels ( ) . getSelectedItems ( ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > totalVmsSetToImport = getImportedVmModels ( ) . getItems ( ) ; getDefaultCommand ( ) . setIsExecutionAllowed ( ( ( selectedVms.size ( ) ) < ( totalVmsSetToImport.size ( ) ) ) ) ; }
Source:
private org.ovirt.engine.ui.common.widget.MenuBar rootMenu ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item ) { org.ovirt.engine.ui.common.widget.MenuBar menuBar = new org.ovirt.engine.ui.common.widget.MenuBar ( true ) ; menuBar.addItem ( messages.menuFor ( item.getName ( ) ) , ( ( com.google.gwt.user.client.Command ) ( null ) ) ) ; menuBar.addSeparator ( ) ; return menuBar ; }

Target:
private void showContextMenu ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel panel , int clientX , int clientY ) { if ( ! ( menu.isEmpty ( ) ) ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel.menuPopup.setWidget ( menu ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel.menuPopup.setPopupPosition ( clientX , clientY ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel.menuPopup.show ( ) ; } }
Source:
private void activeDetailModelChanging ( org.ovirt.engine.ui.uicommonweb.models.EntityModel newValue , org.ovirt.engine.ui.uicommonweb.models.EntityModel oldValue ) { if ( oldValue != null ) { oldValue.setEntity ( null ) ; if ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) { ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) . ensureAsyncSearchStopped ( ) ; } } if ( newValue != null ) { newValue.setEntity ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ; } }

Target:
private void activeDetailModelChanging ( org.ovirt.engine.ui.uicommonweb.models.EntityModel newValue , org.ovirt.engine.ui.uicommonweb.models.EntityModel oldValue ) { if ( oldValue != null ) { oldValue.setEntity ( null ) ; if ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) { ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) . stopRefresh ( ) ; } } if ( newValue != null ) { newValue.setEntity ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID , true ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.QUERY ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }

Target:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface anotherBond = createBond ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) + "1" ) , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; parameters.getInterfaces ( ) . add ( createVlan ( anotherBond , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_DONT_EXIST , anotherBond.getName ( ) ) ; }
Source:
private void setUpGetBallooningExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }
Source:
private void logChangeStatusToConnecting ( long timeoutToFence ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( ( "Host '{}' is not responding. It will stay in Connecting state for a grace period " + "of seconds and after that an attempt to fence the host will be issued." ) , cachedVds.getName ( ) , java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVdsId ( cachedVds.getId ( ) ) ; logable.addCustomValue ( "Seconds" , java.lang.Long.toString ( java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VDS_HOST_NOT_RESPONDING_CONNECTING ) ; }

Target:
private void logHostNonResponding ( long timeoutToFence ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( ( "Host '{}' is not responding. It will stay in Connecting state for a grace period " + "of seconds and after that an attempt to fence the host will be issued." ) , cachedVds.getName ( ) , java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVdsId ( cachedVds.getId ( ) ) ; logable.addCustomValue ( "Seconds" , java.lang.Long.toString ( java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VDS_HOST_NOT_RESPONDING_CONNECTING ) ; }
Source:
public void succeedWhenHostExists ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isHostExists ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , messages ) ; org.junit.Assert.assertTrue ( result ) ; org.junit.Assert.assertTrue ( messages.isEmpty ( ) ) ; }

Target:
public void succeedWhenHostExists ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isHostExists ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , messages ) ; org.junit.jupiter.api.Assertions.assertTrue ( result ) ; org.junit.jupiter.api.Assertions.assertTrue ( messages.isEmpty ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; org.ovirt.engine.core.common.businessentities.permissions permission = org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( permission.getObjectId ( ) , permission.getObjectType ( ) , org.ovirt.engine.core.bll.PermissionsCommandBase.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 > ( ) ; org.ovirt.engine.core.common.businessentities.permissions permission = org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( permission.getObjectId ( ) , permission.getObjectType ( ) , org.ovirt.engine.core.bll.PermissionsCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForDisplayNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( getNetworkCluster ( ) . isDisplay ( ) ) && ( ( ipConfiguration == null ) || ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL ) . when ( failWhen ) ; }

Target:
protected boolean isRoleNetwork ( ) { return ( ( getNetworkCluster ( ) . isDisplay ( ) ) || ( getNetworkCluster ( ) . isMigration ( ) ) ) || ( getNetworkCluster ( ) . isGluster ( ) ) ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public void canDoActionMaxBlockDiskSizeCheckSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.MAX_BLOCK_SIZE ) ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , StorageType.ISCSI ) ; mockStoragePoolIsoMap ( ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionMaxBlockDiskSizeCheckSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.MAX_BLOCK_SIZE ) ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , StorageType.ISCSI ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
public boolean canBeSelected ( ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = ( ( getEntity ( ) . getDisplayType ( ) ) != null ) ? getEntity ( ) . getDisplayType ( ) : getEntity ( ) . getDefaultDisplayType ( ) ; boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; return ( displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) && hasVmSpiceSupport ; }

Target:
public boolean canBeSelected ( ) { boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; return ( getEntity ( ) . getGraphicsInfos ( ) . containsKey ( GraphicsType.SPICE ) ) && hasVmSpiceSupport ; }
Source:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getEngineSshPublicKey ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void initTable ( final org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; portMirroringColumn.makeSortable ( ) ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , constants.portMirroring ( ) , "85px" ) ; }

Target:
public void initTable ( ) { super . initTable ( ) ; getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > portMirroringColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractBooleanColumn < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.virtualMachine.SubTabVirtualMachineNetworkInterfaceView.constants.portMirroringEnabled ( ) ) { @ java.lang.Override public java.lang.Boolean getRawValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { return object.isPortMirroring ( ) ; } } ; portMirroringColumn.makeSortable ( ) ; getTable ( ) . addColumnWithHtmlHeader ( portMirroringColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.virtualMachine.SubTabVirtualMachineNetworkInterfaceView.constants.portMirroring ( ) , "85px" ) ; }
Source:
protected boolean isStorageDomainTypeCorrect ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( ( ( storageDomain.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( storageDomain.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getstorage_pool_type ( ) ) != ( storageDomain.getstorage_type ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; return false ; } return true ; }

Target:
protected boolean isStorageDomainTypeCorrect ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getstorage_pool_type ( ) ) != ( storageDomain.getStorageType ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; return false ; } return true ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getGeoRepSession ( ) . getStatus ( ) . equals ( GeoRepSessionStatus.ACTIVE ) ) && ( ! ( getParameters ( ) . isForce ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_STARTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getGeoRepSession ( ) . getStatus ( ) . equals ( GeoRepSessionStatus.ACTIVE ) ) && ( ! ( getParameters ( ) . isForce ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_STARTED ) ; } return true ; }
Source:
private int calcHostScore ( float hostSchedulingMem , float maxMemory , float lowMemoryLimit , float highMemoryLimit ) { if ( hostSchedulingMem < lowMemoryLimit ) { float memUnderLimit = lowMemoryLimit - hostSchedulingMem ; hostSchedulingMem = java.lang.Math.min ( maxMemory , ( highMemoryLimit + memUnderLimit ) ) ; } return ( ( int ) ( ( hostSchedulingMem / maxMemory ) * ( ( MaxSchedulerWeight ) - 1 ) ) ) + 1 ; }

Target:
private int calcHostScore ( float hostSchedulingMem , float maxMemory , float lowMemoryLimit , float highMemoryLimit ) { if ( hostSchedulingMem < lowMemoryLimit ) { float memUnderLimit = lowMemoryLimit - hostSchedulingMem ; hostSchedulingMem = java.lang.Math.min ( maxMemory , ( highMemoryLimit + memUnderLimit ) ) ; } return ( ( int ) ( ( hostSchedulingMem / maxMemory ) * ( ( getMaxSchedulerWeight ( ) ) - 1 ) ) ) + 1 ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase RunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunAction invoked!" ) ; debugAction ( actionType , params ) ; params.setSessionId ( getSession ( ) . getId ( ) ) ; if ( noBackend ) { org.ovirt.engine.core.common.action.VdcReturnValueBase rValue = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; rValue.setSucceeded ( true ) ; return rValue ; } return getBackend ( ) . runAction ( actionType , params ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunAction invoked!" ) ; debugAction ( actionType , params ) ; params.setSessionId ( getEngineSessionId ( ) ) ; if ( noBackend ) { org.ovirt.engine.core.common.action.VdcReturnValueBase rValue = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; rValue.setSucceeded ( true ) ; return rValue ; } return getBackend ( ) . runAction ( actionType , params ) ; }
Source:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service ) { service.runPublicQuery ( ( ( org.ovirt.engine.core.common.queries.QueryType ) ( operation.getOperation ( ) ) ) , ( ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase ) ( operation.getParameter ( ) ) ) , new com.google.gwt.user.client.rpc.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onFailure ( final java.lang.Throwable exception ) { operation.getCallback ( ) . onFailure ( operation , exception ) ; } @ java.lang.Override public void onSuccess ( final org.ovirt.engine.core.common.queries.VdcQueryReturnValue result ) { operation.getCallback ( ) . onSuccess ( operation , result ) ; } } ) ; }

Target:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service ) { service.runPublicQuery ( ( ( org.ovirt.engine.core.common.queries.QueryType ) ( operation.getOperation ( ) ) ) , ( ( org.ovirt.engine.core.common.queries.QueryParametersBase ) ( operation.getParameter ( ) ) ) , new com.google.gwt.user.client.rpc.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onFailure ( final java.lang.Throwable exception ) { operation.getCallback ( ) . onFailure ( operation , exception ) ; } @ java.lang.Override public void onSuccess ( final org.ovirt.engine.core.common.queries.VdcQueryReturnValue result ) { operation.getCallback ( ) . onSuccess ( operation , result ) ; } } ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StoragePool createStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setName ( "DefaultStoragePool" ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return pool ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StoragePool createStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setName ( "DefaultStoragePool" ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; pool.setIsLocal ( false ) ; pool.setcompatibility_version ( compatibilityVersion ) ; return pool ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc ( vdsServer.glusterVolumeGeoRepConfigList ( volumeName , slaveHost , slaveVolumeName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc ( vdsServer.glusterVolumeGeoRepConfigList ( volumeName , slaveHost , slaveVolumeName , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testInterfaceIsBondWhenInterfaceIsNotBonded ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createVdsNetworkInterfaceWithName ( ) ; iface.setBonded ( false ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , iface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( iface ) . interfaceIsBondOrNull ( ) , matcher ) ; }

Target:
public void testInterfaceIsBondWhenInterfaceIsNotBonded ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createVdsNetworkInterfaceWithName ( ) ; iface.setBonded ( false ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , iface.getName ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( iface ) . interfaceIsBondOrNull ( ) , matcher ) ; }
Source:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warn ( "Can't give console of virtual machine '{}' to user '{}', it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }

Target:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warn ( "Can't give console of virtual machine '{}' to user '{}', it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public char [ ] readPassword ( java.lang.String prompt ) { char [ ] password = java.lang.System.console ( ) . readPassword ( prompt ) ; org.ovirt.engine.core.tools.ToolConsole.log.info ( "Written to console \"{}\"." , prompt ) ; org.ovirt.engine.core.tools.ToolConsole.log.info ( "Read password from console." ) ; return password ; }

Target:
public java.lang.String readPassword ( java.lang.String prompt ) throws java.io.IOException { char [ ] password = java.lang.System.console ( ) . readPassword ( prompt ) ; if ( password == null ) { throw new java.io.IOException ( "EOF" ) ; } org.ovirt.engine.core.tools.ToolConsole.log.info ( "Written to console \"{}\"." , prompt ) ; org.ovirt.engine.core.tools.ToolConsole.log.info ( "Read password from console." ) ; return new java.lang.String ( password ) ; }
Source:
protected boolean canDoAction ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.VmLogonCommand.getVm ( ) ; if ( vm == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.VmLogonCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }

Target:
protected boolean validate ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.VmLogonCommand.getVm ( ) ; if ( vm == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.VmLogonCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }
Source:
public java.util.Set < java.lang.String > getPeers ( java.lang.String server , java.lang.String password ) throws javax.naming.AuthenticationException { org.ovirt.engine.core.utils.ssh.SSHClient client = null ; try { client = connect ( server ) ; authenticate ( client , org.ovirt.engine.core.utils.gluster.GlusterUtil.USER , password ) ; java.lang.String serversXml = executePeerStatusCommand ( client ) ; return extractServers ( serversXml ) ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }

Target:
public java.util.Set < java.lang.String > getPeers ( java.lang.String server , java.lang.String password ) throws javax.naming.AuthenticationException { org.ovirt.engine.core.utils.ssh.EngineSSHClient client = null ; try { client = connect ( server ) ; authenticate ( client , org.ovirt.engine.core.utils.gluster.GlusterUtil.USER , password ) ; java.lang.String serversXml = executePeerStatusCommand ( client ) ; return extractServers ( serversXml ) ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }
Source:
protected void updateTimeZone ( ) { updateTimeZone ( null ) ; }

Target:
private void doUpdateTimeZone ( final java.lang.String selectedTimeZone ) { org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.withLoadedTimeZones ( getTimeZoneType ( ) , new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { final java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel > timeZones = org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.getTimeZones ( getTimeZoneType ( ) ) ; getModel ( ) . getTimeZone ( ) . setItems ( timeZones ) ; getModel ( ) . getTimeZone ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( timeZones , new org.ovirt.engine.ui.uicommonweb.Linq.TimeZonePredicate ( selectedTimeZone ) ) ) ; } } ) ; }
Source:
public void testReapingOnRemoveWithGC ( ) throws java.lang.Exception { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; map.remove ( "two" ) ; assertSizes ( 0 , 1 ) ; assertNull ( map.get ( "three" ) ) ; }

Target:
public void testReapingOnRemoveWithGC ( ) throws java.lang.Exception { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; map.remove ( "two" ) ; assertSizes ( 0 , 1 ) ; org.junit.Assert.assertNull ( map.get ( "three" ) ) ; }
Source:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; setItems ( ( ( java.util.ArrayList ) ( vms ) ) ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > list ) { if ( ( list != null ) && ( ( list.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = list.get ( 0 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExportDomain , new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( dataCenter.getId ( ) , getEntity ( ) . getId ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.storage.SetSortedItemsAsyncQuery ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ) ; } }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosCommitmentReportedBondSpeed ( int totalCommitment ) { return qosCommitmentBondSetup ( totalCommitment , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_4 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage mockDisk ( ) { org.ovirt.engine.core.compat.Guid diskGuid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid itGuid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; final org.ovirt.engine.core.common.businessentities.DiskImage expectedDisk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; expectedDisk.setImageId ( diskGuid ) ; expectedDisk.setImageTemplateId ( itGuid ) ; return expectedDisk ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage mockDisk ( ) { org.ovirt.engine.core.compat.Guid diskGuid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid itGuid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; final org.ovirt.engine.core.common.businessentities.storage.DiskImage expectedDisk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; expectedDisk.setImageId ( diskGuid ) ; expectedDisk.setImageTemplateId ( itGuid ) ; return expectedDisk ; }
Source:
public void testUpdateRole ( ) { existingRole.setdescription ( "This is an updated description" ) ; dao.update ( existingRole ) ; org.ovirt.engine.core.common.businessentities.Role result = dao.get ( existingRole.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingRole , result ) ; }

Target:
public void testUpdateRole ( ) { existingRole.setDescription ( "This is an updated description" ) ; dao.update ( existingRole ) ; org.ovirt.engine.core.common.businessentities.Role result = dao.get ( existingRole.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingRole , result ) ; }
Source:
public void testGetAllForDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > result = dao.getAllForDataCenter ( datacenter ) ; org.ovirt.engine.core.dao.NetworkDAOTest.assertGetAllForClusterResult ( result ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : result ) { org.junit.Assert.assertEquals ( datacenter , net.getstorage_pool_id ( ) ) ; } }

Target:
public void testGetAllForDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > result = dao.getAllForDataCenter ( datacenter ) ; verifyDataCenterNetworks ( result ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid secretUuid = getParameters ( ) . getLibvirtSecret ( ) . getId ( ) ; addCustomValue ( "LibvirtSecretUUID" , secretUuid.toString ( ) ) ; getReturnValue ( ) . setActionReturnValue ( secretUuid ) ; }

Target:
protected void registerLibvirtSecret ( ) { if ( ( getStorageDomain ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsInStatusUp = getAllRunningVdssInPool ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hostsInStatusUp ) { org.ovirt.engine.core.bll.storage.CINDERStorageHelper.registerLibvirtSecrets ( getStorageDomain ( ) , vds , java.util.Collections.singletonList ( getParameters ( ) . getLibvirtSecret ( ) ) ) ; } } else { log.info ( "Libvirt secret '{}' hasn't been registered since storage domain '{}' is not Active" , getParameters ( ) . getLibvirtSecret ( ) . getId ( ) , getStorageDomain ( ) . getName ( ) ) ; } }
Source:
public boolean match ( org.ovirt.engine.core.common.businessentities.DbUser source ) { return ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( source.getDomain ( ) , target.getDomain ( ) ) ) && ( ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( target.getLoginName ( ) ) ) || ( "*" . equals ( target.getLoginName ( ) ) ) ) || ( source.getLoginName ( ) . toLowerCase ( ) . startsWith ( target.getLoginName ( ) ) ) ) ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.DbUser source ) { return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( source.getDomain ( ) , target.getDomain ( ) ) ) && ( ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( target.getLoginName ( ) ) ) || ( "*" . equals ( target.getLoginName ( ) ) ) ) || ( source.getLoginName ( ) . toLowerCase ( ) . startsWith ( target.getLoginName ( ) ) ) ) ; }
Source:
public boolean hasOvercommitMemoryToRunVM ( org.ovirt.engine.core.common.businessentities.VDS curVds , org.ovirt.engine.core.common.businessentities.VM vm ) { double vmMemRequired = ( vm.getMemSizeMb ( ) ) + ( curVds.getGuestOverhead ( ) ) ; double vdsMemLimit = curVds.getMaxSchedulingMemory ( ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "hasOvercommitMemoryToRunVM: host '{}'; max scheduling memory : MB; required memory is MB; Guest overhead MB" , curVds.getName ( ) , vdsMemLimit , vmMemRequired , curVds.getGuestOverhead ( ) ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "{} <= ??? {}" , vmMemRequired , vdsMemLimit ) ; return vmMemRequired <= vdsMemLimit ; }

Target:
public boolean hasOvercommitMemoryToRunVM ( org.ovirt.engine.core.common.businessentities.VDS curVds , org.ovirt.engine.core.common.businessentities.VM vm ) { double vmMemRequired = vmOverheadCalculator.getTotalRequiredMemoryInMb ( vm ) ; if ( org.ovirt.engine.core.common.utils.HugePageUtils.isBackedByHugepages ( vm.getStaticData ( ) ) ) { org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "VM uses HugePages - ignore its memory size" ) ; } double vdsMemLimit = curVds.getMaxSchedulingMemory ( ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "hasOvercommitMemoryToRunVM: host '{}'; max scheduling memory : MB; required memory is MB; Guest overhead MB" , curVds.getName ( ) , vdsMemLimit , vmMemRequired , vmOverheadCalculator.getOverheadInMb ( vm ) ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "{} <= ??? {}" , vmMemRequired , vdsMemLimit ) ; return vmMemRequired <= vdsMemLimit ; }