auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full endAction" ) ; } }

Target:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM is null, not performing full endAction" ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.Erratum getErratumForHost ( java.lang.String hostName , java.lang.String erratumId ) { org.ovirt.engine.core.bll.host.provider.foreman.ContentHost contentHost = findContentHost ( hostName ) ; if ( contentHost == null ) { log.error ( "Failed to find host on provider '{}' by host name '{}' " , getProvider ( ) . getName ( ) , hostName ) ; return null ; } return runErratumMethod ( java.lang.String.format ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.CONTENT_HOST_ERRATUM_ENTRY_POINT , contentHost.getUuid ( ) , erratumId ) ) ; }

Target:
private org.ovirt.engine.core.compat.Version getForemanVersion ( ) { try { org.ovirt.engine.core.bll.host.provider.foreman.ReportedForemanStatus status = objectMapper.readValue ( runHttpGetMethod ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostProviderProxy.API_VERSION_ENTRY_POINT ) , org.ovirt.engine.core.bll.host.provider.foreman.ReportedForemanStatus.class ) ; return new org.ovirt.engine.core.compat.Version ( status.getVersion ( ) ) ; } catch ( java.io.IOException e ) { log.warn ( "Unable to detect Foreman version for provider {}. Using older version to connect to the provider" , getProvider ( ) . getName ( ) ) ; return null ; } }
Source:
private void updateProperties ( ) { org.ovirt.engine.core.common.businessentities.Provider provider = ( ( org.ovirt.engine.core.common.businessentities.Provider ) ( getEntity ( ) ) ) ; setName ( provider.getName ( ) ) ; setDescription ( provider.getDescription ( ) ) ; setUrl ( provider.getUrl ( ) ) ; }

Target:
private void updateProperties ( ) { org.ovirt.engine.core.common.businessentities.Provider provider = ( ( org.ovirt.engine.core.common.businessentities.Provider ) ( getEntity ( ) ) ) ; setName ( provider.getName ( ) ) ; setType ( provider.getType ( ) ) ; setDescription ( provider.getDescription ( ) ) ; setUrl ( provider.getUrl ( ) ) ; }
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 getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void testCronExpressionForWeeklyNoDays ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule schedule = new org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule ( ) ; schedule.setFrequency ( Frequency.WEEKLY ) ; schedule.setHour ( 12 ) ; schedule.setMins ( 50 ) ; java.lang.String expectedExpression = "" ; org.junit.Assert.assertEquals ( expectedExpression , schedule.toCronExpression ( ) ) ; java.util.List < java.lang.Class < ? > > validationGroup = new java.util.ArrayList < > ( ) ; java.util.List < java.lang.String > result = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( validationGroup , schedule ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }

Target:
public void testCronExpressionForWeeklyNoDays ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule schedule = new org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule ( ) ; schedule.setFrequency ( Frequency.WEEKLY ) ; schedule.setHour ( 12 ) ; schedule.setMins ( 50 ) ; java.lang.String expectedExpression = "" ; org.junit.jupiter.api.Assertions.assertEquals ( expectedExpression , schedule.toCronExpression ( ) ) ; java.util.List < java.lang.Class < ? > > validationGroup = new java.util.ArrayList < > ( ) ; java.util.List < java.lang.String > result = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( validationGroup , schedule ) ; org.junit.jupiter.api.Assertions.assertTrue ( result.isEmpty ( ) ) ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE_ENTITY , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > createDiskImageList ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageId ) ; disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageDomainId ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; diskImageList.add ( disk ) ; return diskImageList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskImageList ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setImageId ( diskImageId ) ; disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageDomainId ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; diskImageList.add ( disk ) ; return diskImageList ; }
Source:
public void updateSortOptions ( java.lang.String sortBy , boolean sortAscending ) { boolean shouldRefresh = ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( this . sortBy , sortBy ) ) ) || ( ( this . sortAscending ) != sortAscending ) ; this . sortBy = sortBy ; this . sortAscending = sortAscending ; if ( shouldRefresh ) { refresh ( ) ; } }

Target:
public void updateSortOptions ( java.lang.String sortBy , boolean sortAscending ) { boolean shouldRefresh = ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( this . sortBy , sortBy ) ) ) || ( ( this . sortAscending ) != sortAscending ) ; this . sortBy = sortBy ; this . sortAscending = sortAscending ; if ( shouldRefresh ) { searchString = stripPageKeyword ( searchString ) ; setSearchStringPage ( 1 ) ; refresh ( ) ; } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 0 ) ) , 0 ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StorageDomain getStorageDomain ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { return getCallsHandler ( ) . executeRead ( "Getstorage_domain_by_type_and_storagePoolId" , org.ovirt.engine.core.dao.StorageDomainDAODbFacadeImpl.StorageDomainRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , poolId ) . addValue ( "storage_domain_type" , type.getValue ( ) ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomain getStorageDomain ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { java.lang.Integer statusNum = ( status == null ) ? null : status.getValue ( ) ; return getCallsHandler ( ) . executeRead ( "Getstorage_domain_by_type_storagePoolId_and_status" , org.ovirt.engine.core.dao.StorageDomainDAODbFacadeImpl.StorageDomainRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , poolId ) . addValue ( "storage_domain_type" , type.getValue ( ) ) . addValue ( "status" , statusNum ) ) ; }
Source:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.storage_server_connections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageType > GetStorageTypeList ( ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageType [ ] { org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , org.ovirt.engine.core.common.businessentities.StorageType.FCP } ) ) ; }
Source:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDao ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } if ( ( ( dbUser ) == null ) && ( ( dbGroup ) == null ) ) { dbGroup = dbGroupDao.get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } }

Target:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = dbUserDao.get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } if ( ( ( dbUser ) == null ) && ( ( dbGroup ) == null ) ) { dbGroup = dbGroupDao.get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getAdElementId ( ) ) ; } }
Source:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel ) { return ( ( clusterNetworkModel.isAttached ( ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ) && ( ! ( ( multiCluster ) && ( isManagementOriginally ( clusterNetworkModel ) ) ) ) ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel ) { return ( ( ( clusterNetworkModel.isAttached ( ) ) && ( clusterNetworkModel.isRequired ( ) ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ) && ( ! ( ( multiCluster ) && ( isManagementOriginally ( clusterNetworkModel ) ) ) ) ; }
Source:
public static org.ovirt.engine.core.compat.Guid GetVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { org.ovirt.engine.core.compat.Guid vmGuid = org.ovirt.engine.core.compat.Guid.Empty ; vmGuid = org.ovirt.engine.core.bll.VmPoolCommandBase.getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = org.ovirt.engine.core.bll.VmPoolCommandBase.getNonPrestartedVmToAttach ( poolId ) ; } return vmGuid ; }

Target:
public static org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { org.ovirt.engine.core.compat.Guid vmGuid = org.ovirt.engine.core.compat.Guid.Empty ; vmGuid = org.ovirt.engine.core.bll.VmPoolCommandBase.getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = org.ovirt.engine.core.bll.VmPoolCommandBase.getNonPrestartedVmToAttach ( poolId ) ; } return vmGuid ; }
Source:
public void testVmDuringMigration ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ) . when ( vmValidator ) . vmNotDuringMigration ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS.name ( ) ) ) ; }

Target:
public void testSaveMemoryPciPassthroughFailure ( ) { cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ; }
Source:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { if ( ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) && ( ! ( isImagesAlreadyOnTarget ( ) ) ) ) { org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }

Target:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { if ( ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) && ( ! ( isImagesAlreadyOnTarget ( ) ) ) ) { org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }
Source:
public void bondWithNoNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createBondSlaves ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }

Target:
public void bondWithNoNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }
Source:
public void loadVmsFromKvm ( ) { clearProblem ( ) ; if ( ! ( validateKvmConfiguration ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid proxyId = ( ( getXenProxyHosts ( ) . getSelectedItem ( ) ) != null ) ? getXenProxyHosts ( ) . getSelectedItem ( ) . getId ( ) : null ; loadVMsFromExternalProvider ( OriginType.KVM , getKvmUri ( ) . getEntity ( ) , getKvmUsername ( ) . getEntity ( ) , getKvmPassword ( ) . getEntity ( ) , proxyId ) ; }

Target:
public void loadVmsFromKvm ( ) { clearForLoad ( ) ; if ( ! ( validateKvmConfiguration ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid proxyId = ( ( getXenProxyHosts ( ) . getSelectedItem ( ) ) != null ) ? getXenProxyHosts ( ) . getSelectedItem ( ) . getId ( ) : null ; loadVMsFromExternalProvider ( OriginType.KVM , getKvmUri ( ) . getEntity ( ) , getKvmUsername ( ) . getEntity ( ) , getKvmPassword ( ) . getEntity ( ) , proxyId ) ; }
Source:
public java.lang.StringBuilder getTagNameAndChildrenNames ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_name ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( ( "," + ( tag.getTagNameAndChildrenNames ( ) ) ) ) ; } return builder ; }

Target:
public java.lang.StringBuilder getTagNameAndChildrenNames ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_name ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : _children ) { builder.append ( ( "," + ( tag.getTagNameAndChildrenNames ( ) ) ) ) ; } return builder ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.DevicesVisibilityMapReturnForXmlRpc getDevicesVisibility ( java.lang.String [ ] devicesList ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getDevicesVisibility" ) . withParameter ( "guidList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( devicesList ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "visibles" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.DevicesVisibilityMapReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.DevicesVisibilityMapReturnForXmlRpc getDevicesVisibility ( java.lang.String [ ] devicesList ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getDevicesVisibility" ) . withParameter ( "guidList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( devicesList ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "visible" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.DevicesVisibilityMapReturnForXmlRpc ( response ) ; }
Source:
public void setAdditionalConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel additionalConsoleModel ) { this . additionalConsoleModel = additionalConsoleModel ; }

Target:
private boolean isConsoleCommandsExecutionAllowed ( ) { final java.util.List < org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel > list = getSelectedHasConsoleModels ( ) ; if ( ( list == null ) || ( list.isEmpty ( ) ) ) { return false ; } for ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel hasConsoleModel : list ) { final org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol protocol = consoleUtils.determineConnectionProtocol ( hasConsoleModel ) ; if ( consoleUtils.canShowConsole ( protocol , hasConsoleModel ) ) { return true ; } } return false ; }
Source:
protected org.ovirt.engine.core.common.businessentities.HostDevice generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.HostDevice device = new org.ovirt.engine.core.common.businessentities.HostDevice ( ) ; device.setHostId ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID ) ; device.setDeviceName ( ( ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_DEVICE_NAME ) + "___child" ) ) ; device.setParentDeviceName ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_DEVICE_NAME ) ; device.setCapability ( "pci" ) ; device.setDriver ( "mock driver" ) ; device.setAssignable ( true ) ; return device ; }

Target:
protected org.ovirt.engine.core.common.businessentities.HostDevice generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.HostDevice device = new org.ovirt.engine.core.common.businessentities.HostDevice ( ) ; device.setHostId ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; device.setDeviceName ( ( ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_DEVICE_NAME ) + "___child" ) ) ; device.setParentDeviceName ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_DEVICE_NAME ) ; device.setCapability ( "pci" ) ; device.setDriver ( "mock driver" ) ; device.setAssignable ( true ) ; return device ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ev.equals ( spiceVersionFileFetchedEvent_Definition ) ) { org.ovirt.engine.core.compat.Version spiceVersion = parseVersion ( ( ( org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs ) ( args ) ) . getFileContent ( ) ) ; setSpiceVersion ( spiceVersion ) ; } else if ( ev.equals ( documentationFileFetchedEvent_Definition ) ) { java.lang.String documentationPathFileContent = ( ( org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs ) ( args ) ) . getFileContent ( ) ; org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.init ( documentationPathFileContent ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ev.equals ( spiceVersionFileFetchedEvent_Definition ) ) { org.ovirt.engine.core.compat.Version spiceVersion = parseVersion ( ( ( org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs ) ( args ) ) . getFileContent ( ) ) ; setSpiceVersion ( spiceVersion ) ; } else if ( ev.equals ( documentationFileFetchedEvent_Definition ) ) { java.lang.String documentationPathFileContent = ( ( org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs ) ( args ) ) . getFileContent ( ) ; org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.init ( documentationPathFileContent ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult externalNetworkNotDisplay ( java.lang.String networkName ) { return networkCluster.isDisplay ( ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_DISPLAY , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , networkName ) ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult createMissingIpValidationResult ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface missingIpNic , java.lang.String networkName ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ADDR_MANDATORY_FOR_ROLE_NETWORK , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , networkName ) , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NIC_NAME_REPLACEMENT , missingIpNic.getName ( ) ) , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.HOST_NAME_REPLACEMENT , missingIpNic.getVdsName ( ) ) ) ; }
Source:
public void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK_NO_DOMAIN : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK_NO_DOMAIN ; } return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK_NO_DOMAIN : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK_NO_DOMAIN ; } return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( result ) ; } }

Target:
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 void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true ) ; } }

Target:
protected void addVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog vmWatchdog = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getWatchdog ( ) ; if ( vmWatchdog != null ) { org.ovirt.engine.core.common.action.WatchdogParameters parameters = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; parameters.setId ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) ; parameters.setAction ( vmWatchdog.getAction ( ) ) ; parameters.setModel ( vmWatchdog.getModel ( ) ) ; org.ovirt.engine.core.bll.AddVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.AddWatchdog , parameters ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter lookupEntity ( org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter > parameters = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter.class , VdcQueryType.GetVmInterfaceFilterParameterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter parameter : parameters ) { if ( ( id.equals ( parameter.getId ( ) ) ) || ( name.equals ( parameter.getName ( ) ) ) ) { return parameter ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter lookupEntity ( org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter > parameters = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter.class , QueryType.GetVmInterfaceFilterParameterById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter parameter : parameters ) { if ( ( id.equals ( parameter.getId ( ) ) ) || ( name.equals ( parameter.getName ( ) ) ) ) { return parameter ; } } return null ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllValidationPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllValidationPass , waitForResult , null ) ; } }

Target:
public java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > runInternalMultipleActions ( org.ovirt.engine.core.common.action.ActionType actionType , java.util.List < org.ovirt.engine.core.common.action.ActionParametersBase > parameters ) { return runMultipleActionsImpl ( actionType , parameters , true , false , false , null ) ; }
Source:
private static java.lang.Double truncatePercentage ( java.lang.Double value ) { return value == null ? null : java.lang.Math.min ( 100 , value ) ; }

Target:
private static void updateAdditionalFeatures ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { java.lang.String [ ] addtionalFeaturesSupportedByHost = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.AssignStringArrayValue ( xmlRpcStruct , VdsProperties.ADDITIONAL_FEATURES ) ; if ( addtionalFeaturesSupportedByHost != null ) { for ( java.lang.String feature : addtionalFeaturesSupportedByHost ) { vds.getAdditionalFeatures ( ) . add ( feature ) ; } } }
Source:
private void setUpParentMock ( org.ovirt.engine.api.restapi.resource.BackendHostsResource parent ) { parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setSessionHelper ( sessionHelper ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }

Target:
private void setUpParentMock ( org.ovirt.engine.api.restapi.resource.BackendHostsResource parent ) { parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setSessionHelper ( sessionHelper ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }
Source:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { this . runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; tracking.getClient ( ) . disconnect ( ) ; }

Target:
private void remove ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id , org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response ) { this . runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( response ) ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.Converter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object source ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
private org.ovirt.engine.api.model.RSDL construct ( ) throws java.io.IOException , java.lang.ClassNotFoundException { org.ovirt.engine.api.model.RSDL rsdl = new org.ovirt.engine.api.model.RSDL ( ) ; rsdl.setLinks ( new org.ovirt.engine.api.model.DetailedLinks ( ) ) ; for ( org.ovirt.engine.api.model.DetailedLink link : getLinks ( ) ) { rsdl.getLinks ( ) . getLinks ( ) . add ( link ) ; } return rsdl ; }

Target:
public int compare ( org.ovirt.engine.api.model.DetailedLink dl1 , org.ovirt.engine.api.model.DetailedLink dl2 ) { int res = dl1.getHref ( ) . compareTo ( dl2.getHref ( ) ) ; return res != 0 ? res : dl1.getRel ( ) . compareTo ( dl2.getRel ( ) ) ; }
Source:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( user ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; junit.framework.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }

Target:
public void testGetUserIDWithNoUser ( ) { org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; org.junit.Assert.assertEquals ( "wrong guid" , null , query.getUserID ( ) ) ; }
Source:
public static java.lang.String getPassFromFile ( java.lang.String passFile ) throws java.io.IOException { java.io.FileReader input = new java.io.FileReader ( passFile ) ; java.io.BufferedReader br = new java.io.BufferedReader ( input ) ; java.lang.String pass = br.readLine ( ) ; try { input.close ( ) ; br.close ( ) ; } catch ( java.lang.Exception e ) { } return pass ; }

Target:
public static java.lang.String getPassFromFile ( java.lang.String passFile ) throws java.io.IOException { java.io.File f = new java.io.File ( passFile ) ; if ( ! ( f.exists ( ) ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } java.io.FileReader input = new java.io.FileReader ( passFile ) ; java.io.BufferedReader br = new java.io.BufferedReader ( input ) ; java.lang.String pass = br.readLine ( ) ; try { input.close ( ) ; br.close ( ) ; } catch ( java.lang.Exception e ) { } if ( pass == null ) { return org.apache.commons.lang.StringUtils.EMPTY ; } return pass ; }
Source:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
private javax.servlet.http.HttpSession getSession ( ) { javax.servlet.http.HttpServletRequest request = this . getThreadLocalRequest ( ) ; javax.servlet.http.HttpSession session = request.getSession ( ) ; org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( ( ( ( ( "IP [" + ( request.getRemoteAddr ( ) ) ) + "], Session ID [" ) + ( session.getId ( ) ) ) + "]" ) ) ; return session ; }

Target:
private javax.servlet.http.HttpSession getSession ( ) { javax.servlet.http.HttpServletRequest request = this . getThreadLocalRequest ( ) ; javax.servlet.http.HttpSession session = request.getSession ( ) ; org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "IP '{}', Session ID '{}'" , request.getRemoteAddr ( ) , session.getId ( ) ) ; return session ; }
Source:
public void dump ( org.ovirt.engine.api.extensions.ExtMap map , java.lang.String indent ) { if ( map != null ) { org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "--- Begin AuthRecord ---" ) ; org.ovirt.engine.exttool.aaa.AAAServiceImpl.Dump.dumpRecord ( map , java.util.Collections.< org.ovirt.engine.api.extensions.ExtKey > emptyList ( ) , "AuthRecord" , "" ) ; org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "--- End AuthRecord ---" ) ; } }

Target:
public void dump ( org.ovirt.engine.exttool.aaa.AAAServiceImpl module , org.ovirt.engine.api.extensions.ExtMap map , java.lang.String indent ) { if ( map != null ) { org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "--- Begin AuthRecord ---" ) ; org.ovirt.engine.exttool.aaa.AAAServiceImpl.Dump.dumpRecord ( module , map , java.util.Collections.< org.ovirt.engine.api.extensions.ExtKey > emptyList ( ) , "AuthRecord" , "" ) ; org.ovirt.engine.exttool.aaa.AAAServiceImpl.log.info ( "--- End AuthRecord ---" ) ; } }
Source:
public void validateSucceedsOnStoppedVolume ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STOPPED_VOLUME_ID ) , null ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( cmd ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STOPPED_VOLUME_ID ) ) . when ( volumeDao ) . getById ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STOPPED_VOLUME_ID ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STARTED_VOLUME_ID ) ) . when ( volumeDao ) . getById ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STARTED_VOLUME_ID ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnapshotsDummiesForStorageAllocations ( ) ; return disksList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnapshotsDummiesForStorageAllocations ( ) ; return disksList ; }