auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.Date readDate ( ) { java.lang.String image = readString ( ) ; try { return org.ovirt.api.metamodel.runtime.xml.XmlReader.DATE_FORMAT.get ( ) . parse ( image ) ; } catch ( java.text.ParseException exception ) { throw new org.ovirt.api.metamodel.runtime.xml.XmlException ( ( ( "The text \"" + image ) + "\" isn\'t a valid date value" ) ) ; } }

Target:
public java.util.List < java.lang.String > readStrings ( ) { java.util.List < java.lang.String > values = new java.util.ArrayList < > ( ) ; java.lang.String startingLocalName = reader.getLocalName ( ) ; java.lang.String currentLocalName = startingLocalName ; while ( forward ( ) ) { currentLocalName = reader.getLocalName ( ) ; if ( currentLocalName.equals ( startingLocalName ) ) { values.add ( readString ( ) ) ; } else { skip ( ) ; } } return values ; }
Source:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void getVolumeSnapshotSchedule ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testSimpleParse ( ) throws java.lang.Exception { filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( "include:VDC_STOP(snmp:) " + "exclude:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "VDC_STOP" ) ) ; org.ovirt.engine.core.notifier.filter.AuditLogEvent event = snmp.getEvents ( ) . get ( 0 ) ; java.lang.String address = snmp.getNames ( ) . get ( 0 ) ; org.junit.Assert.assertTrue ( event.getName ( ) . equals ( "VDC_STOP" ) ) ; org.junit.Assert.assertTrue ( address.equals ( "" ) ) ; }

Target:
public void testSimpleParse ( ) throws java.lang.Exception { filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( "include:VDC_STOP(snmp:) " + "exclude:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "VDC_STOP" ) ) ; org.junit.Assert.assertTrue ( snmp.getEvents ( ) . contains ( "VDC_STOP-->" ) ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturn executeImageActionVdsBrokerCommand ( java.lang.String spId , java.lang.String sdId , java.lang.String imgGroupId , java.lang.String imgId ) { return org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageVDSCommand.getBroker ( ) . prepareImage ( spId , sdId , imgGroupId , imgId , org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageVDSCommand.getParameters ( ) . getAllowIllegal ( ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturn executeImageActionVdsBrokerCommand ( java.lang.String spId , java.lang.String sdId , java.lang.String imgGroupId , java.lang.String imgId ) { prepareImageReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageVDSCommand.getBroker ( ) . prepareImage ( spId , sdId , imgGroupId , imgId , org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageVDSCommand.getParameters ( ) . getAllowIllegal ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageVDSCommand.proceedProxyReturnValue ( ) ; return prepareImageReturn ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > getFilterPolicyUnits ( ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : getPolicyUnits ( ) ) { if ( ( policyUnit.getPolicyUnitType ( ) ) == ( org.ovirt.engine.core.common.scheduling.PolicyUnitType.Filter ) ) { list.add ( policyUnit ) ; } } return list ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > getFilterPolicyUnits ( ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : getPolicyUnits ( ) ) { if ( ( policyUnit.getPolicyUnitType ( ) ) == ( org.ovirt.engine.core.common.scheduling.PolicyUnitType.FILTER ) ) { list.add ( policyUnit ) ; } } return list ; }
Source:
private void modelReady ( ) { initVNumaNodes ( ) ; getModelReady ( ) . raise ( this , EventArgs.EMPTY ) ; stopProgress ( ) ; }

Target:
public void pinVNode ( org.ovirt.engine.core.compat.Guid sourceVMGuid , int sourceVNumaIndex , int pNumaNodeIndex ) { org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel vNodeModel = getNodeModel ( sourceVMGuid , sourceVNumaIndex ) ; if ( vNodeModel.isPinned ( ) ) { assignedNumaNodes.get ( vNodeModel.getHostNodeIndex ( ) ) . remove ( vNodeModel ) ; } else { unassignedNumaNodes.remove ( vNodeModel ) ; } vmsToUpdate.add ( vNodeModel.getVm ( ) . getId ( ) ) ; vNodeModel.pinTo ( pNumaNodeIndex ) ; assignVNumaToPhysicalNuma ( vNodeModel ) ; modelReady ( ) ; }
Source:
public void canDoActionSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void validateSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
private void loadVncData ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel model , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { if ( ! ( ( model.getDefaultConsoleModel ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ) { return ; } model.setSelectedProtocol ( ConsoleProtocol.VNC ) ; try { asVncConsoleModel ( model ) . setVncImplementation ( VncConsoleModel.ClientConsoleMode.valueOf ( clientStorage.getLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) ) ) ) ; } catch ( java.lang.Exception e ) { } }

Target:
private void loadVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { vmConsoles.selectProtocol ( ConsoleProtocol.VNC ) ; try { vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) . setVncImplementation ( VncConsoleModel.ClientConsoleMode.valueOf ( clientStorage.getLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) ) ) ) ; } catch ( java.lang.Exception e ) { } }
Source:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getStatus ( ) . name ( ) ) ; if ( ( vmToUpdate.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) { org.ovirt.engine.core.vdsbroker.VmsMonitoring.logVmStatusTransionFromUnknown ( vmToUpdate , runningVm ) ; } } }

Target:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.info ( "VM moved from --> {}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getStatus ( ) . name ( ) ) ; if ( ( vmToUpdate.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) { org.ovirt.engine.core.vdsbroker.VmsMonitoring.logVmStatusTransionFromUnknown ( vmToUpdate , runningVm ) ; } } }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase createDefaultConcreteException ( java.lang.String errorMessage ) { org.ovirt.engine.core.common.businessentities.StorageDomain domainFromDb = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( domainFromDb == null ) || ( ( domainFromDb.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.vdsbroker.irsbroker.IrsOperationFailedNoFailoverException ( errorMessage ) ; } return super . createDefaultConcreteException ( errorMessage ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase createDefaultConcreteException ( java.lang.String errorMessage ) { org.ovirt.engine.core.common.businessentities.StorageDomain domainFromDb = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( domainFromDb == null ) || ( ! ( domainFromDb.getStorageDomainType ( ) . isDataDomain ( ) ) ) ) { return new org.ovirt.engine.core.vdsbroker.irsbroker.IrsOperationFailedNoFailoverException ( errorMessage ) ; } return super . createDefaultConcreteException ( errorMessage ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.SshPublicKey pubkey ) { validateParameters ( pubkey , "content" ) ; org.ovirt.engine.core.common.action.UserProfileParameters params = new org.ovirt.engine.core.common.action.UserProfileParameters ( ) ; org.ovirt.engine.core.common.businessentities.UserProfile profile = map ( pubkey ) ; profile.setUserId ( userId ) ; params.setUserProfile ( profile ) ; return performAction ( VdcActionType.AddUserProfile , params ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.SshPublicKey pubkey ) { validateParameters ( pubkey , "content" ) ; org.ovirt.engine.core.common.action.UserProfileParameters params = new org.ovirt.engine.core.common.action.UserProfileParameters ( ) ; org.ovirt.engine.core.common.businessentities.UserProfile profile = map ( pubkey ) ; profile.setUserId ( userId ) ; params.setUserProfile ( profile ) ; return performAction ( ActionType.AddUserProfile , params ) ; }
Source:
public void shouldHaveNotingToMigrate ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.never ( ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldHaveNotingToMigrate ( ) { org.mockito.Mockito.when ( rulesEnforcer.chooseNextVmToMigrate ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.never ( ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic updateDiskImageDynamicIntoDB ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( image.getImageId ( ) ) ; diskDynamic.setactual_size ( image.getActualSizeInBytes ( ) ) ; getDiskImageDynamicDao ( ) . save ( diskDynamic ) ; return diskDynamic ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic updateDiskImageDynamicIntoDB ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( image.getImageId ( ) ) ; diskDynamic.setactual_size ( image.getActualSizeInBytes ( ) ) ; org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDynamicDao ( ) . save ( diskDynamic ) ; return diskDynamic ; }
Source:
protected void executeVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getBroker ( ) . getStorageDomainStats ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.buildStorageDynamicFromXmlRpcStruct ( result.storageStats ) ; domain.setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( domain ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getBroker ( ) . getStorageDomainStats ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.buildStorageDynamicStruct ( result.storageStats ) ; domain.setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( domain ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.dao.network.DnsResolverConfigurationDao dnsResolverConfigurationDao = dbFacade.getDnsResolverConfigurationDao ( ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( result.getDnsResolverConfiguration ( ) . getId ( ) , FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ; dao.remove ( result.getId ( ) ) ; org.junit.Assert.assertNull ( dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.dao.network.DnsResolverConfigurationDao dnsResolverConfigurationDao = dbFacade.getDnsResolverConfigurationDao ( ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( result.getDnsResolverConfiguration ( ) . getId ( ) , FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ; dao.remove ( result.getId ( ) ) ; org.junit.Assert.assertNull ( dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }
Source:
private void editCheckBoxes ( org.ovirt.engine.ui.uicommonweb.models.userportal.IUserPortalListModel model , org.ovirt.engine.ui.userportal.widget.popup.console.EntityModelValueCheckBoxEditor < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > ... checkBoxes ) { for ( org.ovirt.engine.ui.userportal.widget.popup.console.EntityModelValueCheckBoxEditor < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > checkBox : checkBoxes ) { checkBox.asEditor ( ) . getSubEditor ( ) . setValue ( ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( model.getSelectedItem ( ) ) ) . getDefaultConsole ( ) ) ; } }

Target:
private void editCheckBoxes ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalConsolePopupModel model , org.ovirt.engine.ui.userportal.widget.popup.console.EntityModelValueCheckBoxEditor < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > ... checkBoxes ) { for ( org.ovirt.engine.ui.userportal.widget.popup.console.EntityModelValueCheckBoxEditor < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > checkBox : checkBoxes ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel defaultConsole = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( model.getModel ( ) . getSelectedItem ( ) ) ) . getDefaultConsole ( ) ; checkBox.asEditor ( ) . getSubEditor ( ) . setValue ( defaultConsole ) ; } }
Source:
public org.ovirt.optimizer.util.ConfigProvider load ( ) { java.io.FileReader reader = null ; try { reader = new java.io.FileReader ( configFile ) ; config.load ( reader ) ; } catch ( java.io.IOException ex ) { org.ovirt.optimizer.util.ConfigProvider.log.error ( "Connection to oVirt REST server failed" , ex ) ; } finally { try { if ( reader != null ) { reader.close ( ) ; } } catch ( java.io.IOException ex ) { org.ovirt.optimizer.util.ConfigProvider.log.error ( "The config file could not be closed" , ex ) ; } } return this ; }

Target:
public org.ovirt.optimizer.config.ConfigProvider load ( ) { java.io.FileReader reader = null ; try { reader = new java.io.FileReader ( configFile ) ; config.load ( reader ) ; } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.error ( "Connection to oVirt REST server failed" , ex ) ; } finally { try { if ( reader != null ) { reader.close ( ) ; } } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.error ( "The config file could not be closed" , ex ) ; } } return this ; }
Source:
public boolean getAllCleared ( ) { synchronized ( _listTasks ) { for ( org.ovirt.engine.core.bll.EntityAsyncTask task : _listTasks.values ( ) ) { if ( ! ( taskWasCleared ( task ) ) ) { return false ; } } } return true ; }

Target:
public boolean getAllCleared ( ) { synchronized ( _listTasks ) { for ( org.ovirt.engine.core.bll.EntityAsyncTask task : _listTasks.values ( ) ) { if ( ! ( taskWasCleared ( task ) ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "[within thread]: Some of the tasks related to command id {0} were not cleared yet (Task id {1} is in state {2})." , getCommandId ( ) , task.getVdsmTaskId ( ) , task.getState ( ) ) ; return false ; } } } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain createDataStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name , org.ovirt.engine.core.compat.Guid sdId ) { final org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setStorageName ( name ) ; storageDomain.setStatus ( status ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setId ( sdId ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain createDataStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name , org.ovirt.engine.core.compat.Guid sdId ) { final org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setStorageName ( name ) ; storageDomain.setStatus ( status ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setId ( sdId ) ; storageDomain.setHostedEngineStorage ( false ) ; return storageDomain ; }
Source:
private boolean isAgentSupported ( org.ovirt.engine.core.common.businessentities.VDS vds ) { boolean ret = false ; org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( _vds.getManagementIp ( ) ) ) { ret = options.isAgentSupported ( _vds.getPmType ( ) ) ; } if ( org.apache.commons.lang.StringUtils.isNotEmpty ( _vds.getPmSecondaryIp ( ) ) ) { ret = options.isAgentSupported ( _vds.getPmSecondaryType ( ) ) ; } return ret ; }

Target:
private java.lang.String getOptions ( org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { org.ovirt.engine.core.common.businessentities.ArchitectureType architectureType = org.ovirt.engine.core.bll.VdsArchitectureHelper.getArchitecture ( _vds.getStaticData ( ) ) ; java.lang.String managementOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getDefaultAgentOptions ( agent.getType ( ) , agent.getOptions ( ) , architectureType ) ; return managementOptions ; }
Source:
private void initFilter ( ) { filter = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainSpaceRequirementsFilter ( memoryDisks ) ) ; org.mockito.Mockito.doNothing ( ) . when ( filter ) . updateDisksStorage ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( filter ) . getStorageDomainValidator ( storageDomain ) ; }

Target:
private void initFilter ( ) { filter = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainSpaceRequirementsFilter ( org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.memory.MemoryStorageHandler.class ) , memoryDisks ) ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( filter ) . getStorageDomainValidator ( storageDomain ) ; }
Source:
private void init ( ) { this . setIsAnimated ( TooltipConfig.IS_ANIMATED ) ; this . setPlacement ( TooltipConfig.PLACEMENT ) ; this . setIsHtml ( TooltipConfig.IS_HTML ) ; this . setTrigger ( TooltipConfig.TRIGGER ) ; this . setShowDelayMs ( TooltipConfig.SHOW_DELAY_MS ) ; this . setHideDelayMs ( TooltipConfig.HIDE_DELAY_MS ) ; this . setContainer ( TooltipConfig.CONTAINER ) ; }

Target:
private void applyTooltip ( ) { if ( ( getWidget ( ) ) == null ) { return ; } if ( ( widgetAttached ) && ( ( tooltip ) != null ) ) { org.ovirt.engine.ui.common.utils.ElementTooltipUtils.setTooltipOnElement ( getWidget ( ) . getElement ( ) , tooltip , tooltipConfig ) ; } else if ( ! ( widgetAttached ) ) { org.ovirt.engine.ui.common.utils.ElementTooltipUtils.destroyTooltip ( getWidget ( ) . getElement ( ) ) ; } }
Source:
public void setOffset ( int left ) { asWidget ( ) . getElement ( ) . getStyle ( ) . setLeft ( left , Unit.PX ) ; asWidget ( ) . getElement ( ) . getStyle ( ) . setWidth ( ( ( com.google.gwt.user.client.Window.getClientWidth ( ) ) - left ) , Unit.PX ) ; recalculateSize ( ) ; showScrollButtons ( ) ; }

Target:
public void setOffset ( int left , boolean wantsLeft ) { if ( wantsLeft ) { asWidget ( ) . getElement ( ) . getStyle ( ) . setLeft ( left , Unit.PX ) ; } asWidget ( ) . getElement ( ) . getStyle ( ) . setWidth ( ( ( com.google.gwt.user.client.Window.getClientWidth ( ) ) - left ) , Unit.PX ) ; recalculateSize ( ) ; showScrollButtons ( ) ; }
Source:
private boolean validateExternalNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator ) { return ( ( validate ( validator.externalNetworkSupported ( ) ) ) && ( validate ( validator.externalNetworkNotDisplay ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.externalNetworkNotRequired ( getNetworkName ( ) ) ) ) ; }

Target:
private boolean validateExternalNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase validator ) { return ( ( validate ( validator.externalNetworkSupported ( ) ) ) && ( validate ( validator.externalNetworkNotDisplay ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.externalNetworkNotRequired ( getNetworkName ( ) ) ) ) ; }
Source:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmWatchdogDevices = getVmWatchdogDevices ( ) ; if ( ( vmWatchdogDevices != null ) && ( ! ( vmWatchdogDevices.isEmpty ( ) ) ) ) { return failValidation ( EngineMessage.WATCHDOG_ALREADY_EXISTS ) ; } if ( ! ( validate ( validateWatchdog ( ) ) ) ) { return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmWatchdogDevices = vmDeviceUtils.getWatchdogs ( getParameters ( ) . getId ( ) ) ; if ( ( vmWatchdogDevices != null ) && ( ! ( vmWatchdogDevices.isEmpty ( ) ) ) ) { return failValidation ( EngineMessage.WATCHDOG_ALREADY_EXISTS ) ; } if ( ! ( validate ( validateWatchdog ( ) ) ) ) { return false ; } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setCompatibilityVersion ( compatibilityVersion ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }
Source:
protected boolean canDoAction ( ) { loadStorageDomain ( ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { loadStorageDomain ( ) ; if ( ! ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator ( storageDomain ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
public static void GetExternalNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }

Target:
public static void getAllVnicProfiles ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" } : new java.lang.String [ ] { "templates" , "vms" , "files" } ; }

Target:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" , "storageconnections" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" , "storageconnections" } : new java.lang.String [ ] { "templates" , "vms" , "files" } ; }
Source:
public synchronized boolean hasTasksByStoragePoolId ( org.ovirt.engine.core.compat.Guid storagePoolID ) { boolean retVal = false ; if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.tasks.SPMAsyncTask task : _tasks.values ( ) ) { if ( task.getStoragePoolID ( ) . equals ( storagePoolID ) ) { retVal = true ; break ; } } } return retVal ; }

Target:
public synchronized boolean hasTasksByStoragePoolId ( org.ovirt.engine.core.compat.Guid storagePoolID ) { boolean retVal = false ; if ( ( _tasks ) != null ) { for ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task : _tasks.values ( ) ) { if ( task.getStoragePoolID ( ) . equals ( storagePoolID ) ) { retVal = true ; break ; } } } return retVal ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmInit buildCloudInitParameters ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { if ( model.getVmInitEnabled ( ) . getEntity ( ) ) { return buildModelSpecificParameters ( model.getIsWindowsOS ( ) ) ; } else { return null ; } }

Target:
public org.ovirt.engine.core.common.businessentities.VmInit buildCloudInitParameters ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { if ( ( model.getVmInitEnabled ( ) . getEntity ( ) ) || ( model.getSysprepEnabled ( ) . getEntity ( ) ) ) { return buildModelSpecificParameters ( model.getIsWindowsOS ( ) ) ; } else { return null ; } }
Source:
protected void setQcowCompat ( org.ovirt.engine.core.common.businessentities.storage.Image diskImage , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid newImageGroupId , org.ovirt.engine.core.compat.Guid newImageId , org.ovirt.engine.core.compat.Guid newStorageDomainID , org.ovirt.engine.core.compat.Guid hostIdForExecution ) { diskImage.setQcowCompat ( QcowCompat.QCOW2_V2 ) ; if ( org.ovirt.engine.core.common.FeatureSupported.qcowCompatSupported ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.QemuImageInfo qemuImageInfo = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getQemuImageInfoFromVdsm ( storagePoolId , newStorageDomainID , newImageGroupId , newImageId , hostIdForExecution , ( hostIdForExecution == null ) ) ; if ( qemuImageInfo != null ) { diskImage.setQcowCompat ( qemuImageInfo.getQcowCompat ( ) ) ; } } }

Target:
protected void setQcowCompat ( org.ovirt.engine.core.common.businessentities.storage.Image diskImage , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid newImageGroupId , org.ovirt.engine.core.compat.Guid newImageId , org.ovirt.engine.core.compat.Guid newStorageDomainID , org.ovirt.engine.core.compat.Guid hostIdForExecution ) { diskImage.setQcowCompat ( QcowCompat.QCOW2_V2 ) ; if ( org.ovirt.engine.core.common.FeatureSupported.qcowCompatSupported ( org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.QemuImageInfo qemuImageInfo = imagesHandler.getQemuImageInfoFromVdsm ( storagePoolId , newStorageDomainID , newImageGroupId , newImageId , hostIdForExecution , ( hostIdForExecution == null ) ) ; if ( qemuImageInfo != null ) { diskImage.setQcowCompat ( qemuImageInfo.getQcowCompat ( ) ) ; } } }
Source:
protected void SelectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . SelectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { UpdateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { updateConsoleModels ( ) ; } }

Target:
protected void selectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . selectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { UpdateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { updateConsoleModels ( ) ; } }
Source:
private void verifyVmAffinities ( final org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.VmAffinities vmAffinities ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( new org.ovirt.engine.api.model.Version ( ) { { major = version.getMajor ( ) ; minor = version.getMinor ( ) ; } } , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResourceTest.VERSION_2_3 ) ) { assertNotNull ( vmAffinities ) ; } else { assertEquals ( null , vmAffinities ) ; } }

Target:
private void verifyVmAffinities ( final org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.VmAffinities vmAffinities ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( new org.ovirt.engine.api.model.Version ( ) { { major = version.getMajor ( ) ; minor = version.getMinor ( ) ; } } , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResourceTest.VERSION_2_3 ) ) { assertNotNull ( vmAffinities ) ; } else { assertNull ( vmAffinities ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobStatus pollEntityIfSupported ( org.ovirt.engine.core.bll.CommandBase < ? > cmd ) { if ( ! ( cmd instanceof org.ovirt.engine.core.bll.storage.EntityPollingCommand ) ) { log.error ( "Command id: '{}': entity polling isn't supported, will retry to poll the job soon" , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; return null ; } try { return ( ( org.ovirt.engine.core.bll.storage.EntityPollingCommand ) ( cmd ) ) . poll ( ) ; } catch ( java.lang.Exception e ) { log.error ( "Command id: '{}': failed to poll the command entity" , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.HostJobInfo.HostJobStatus pollEntity ( org.ovirt.engine.core.bll.CommandBase < ? > cmd ) { try { return ( ( org.ovirt.engine.core.bll.storage.EntityPollingCommand ) ( cmd ) ) . poll ( ) ; } catch ( java.lang.Exception e ) { log.error ( "Command id: '{}': failed to poll the command entity" , cmd.getActionType ( ) , cmd.getCommandId ( ) ) ; } return null ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { boolean nicActuallyExistsOrReferencesNewBond = isNicActuallyExistsOrReferencesNewBond ( attachment.getNicName ( ) , attachment.getNicId ( ) ) ; if ( nicActuallyExistsOrReferencesNewBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( getName ( ) ) . append ( " {id=" ) . append ( getId ( ) ) . append ( ", description=" ) . append ( getDescription ( ) ) . append ( ", profile type=" ) . append ( getProfileType ( ) . name ( ) ) . append ( ", qosId=" ) . append ( getQosId ( ) ) ; return builder.toString ( ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return tsb.append ( "id" , getId ( ) ) . append ( "description" , getDescription ( ) ) . append ( "profileType" , getProfileType ( ) ) . append ( "qosId" , getQosId ( ) ) ; }
Source:
public static void GetClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > > entities = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > > ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > importEntityData = entities.getSelectedItem ( ) ; if ( importEntityData != null ) { registerEntityInfoPanel.updateTabsData ( importEntityData ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < D > entities = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel < D > ) ( sender ) ) ; D importEntityData = entities.getSelectedItem ( ) ; if ( importEntityData != null ) { registerEntityInfoPanel.updateTabsData ( importEntityData ) ; } }
Source:
public void dataCenterExists ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; hsp.setStoragePoolId ( id ) ; org.mockito.Mockito.when ( storagePoolDao.get ( id ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ) ; org.junit.Assert.assertThat ( validator.storagePoolExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void dataCenterExists ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; hsp.setStoragePoolId ( id ) ; org.mockito.Mockito.when ( storagePoolDao.get ( id ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.storagePoolExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected boolean validateVdsCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = getVdsGroupDAO ( ) . getAllForStoragePool ( getParameters ( ) . getStoragePoolId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : groups ) { if ( group.getId ( ) . equals ( getParameters ( ) . getVdsGroupId ( ) ) ) { return true ; } } return failCanDoAction ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) ; }

Target:
protected boolean validateVdsCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( getParameters ( ) . getStoragePoolId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : groups ) { if ( group.getId ( ) . equals ( getParameters ( ) . getVdsGroupId ( ) ) ) { return true ; } } return failCanDoAction ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) ; }