auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.businessentities.Snapshot getSnapshot ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk lastCinderVolume ) { org.ovirt.engine.core.compat.Guid vmSnapshotId = lastCinderVolume.getVmSnapshotId ( ) ; org.ovirt.engine.core.common.businessentities.Snapshot updated = null ; if ( ( vmSnapshotId != null ) && ( ! ( Guid.Empty.equals ( vmSnapshotId ) ) ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getSnapshotDao ( ) . get ( vmSnapshotId ) ; if ( snapshot != null ) { updated = org.ovirt.engine.core.bll.ImagesHandler.prepareSnapshotConfigWithoutImageSingleImage ( snapshot , lastCinderVolume.getImageId ( ) ) ; } } return updated ; }

Target:
private org.ovirt.engine.core.common.businessentities.Snapshot getSnapshotWithoutCinderVolume ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk lastCinderVolume ) { org.ovirt.engine.core.compat.Guid vmSnapshotId = lastCinderVolume.getVmSnapshotId ( ) ; org.ovirt.engine.core.common.businessentities.Snapshot updated = null ; if ( ( vmSnapshotId != null ) && ( ! ( Guid.Empty.equals ( vmSnapshotId ) ) ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getSnapshotDao ( ) . get ( vmSnapshotId ) ; if ( snapshot != null ) { updated = org.ovirt.engine.core.bll.ImagesHandler.prepareSnapshotConfigWithoutImageSingleImage ( snapshot , lastCinderVolume.getImageId ( ) ) ; } } return updated ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( 0 , true ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( 0 , true ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = diskImageDao.getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { baseDiskDao.remove ( snapshot.getId ( ) ) ; } }

Target:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; imageDao.remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = diskImageDao.getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { baseDiskDao.remove ( snapshot.getId ( ) ) ; } }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( value != null ) { sb.append ( template.link ( id ) ) ; super . render ( context , value , sb , ( id + ( org.ovirt.engine.ui.common.widget.table.cell.LinkCell.CONTENT_ID_SUFFIX ) ) ) ; sb.appendHtmlConstant ( "</a>" ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml safeValue = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( value ) ; sb.append ( template.containerAndLink ( getStyleClass ( ) , getRenderElementId ( context ) , safeValue ) ) ; } }
Source:
private java.util.Set < java.lang.String > getInterfaceNetworkNames ( ) { if ( ( cachedInterfaceNetworkNames ) == null ) { cachedInterfaceNetworkNames = org.ovirt.engine.core.common.businessentities.Entities.vmInterfacesByNetworkName ( vm.getInterfaces ( ) ) . keySet ( ) ; } return cachedInterfaceNetworkNames ; }

Target:
private java.util.Set < java.lang.String > getInterfaceNetworkNames ( ) { if ( ( cachedInterfaceNetworkNames ) == null ) { cachedInterfaceNetworkNames = vm.getInterfaces ( ) . stream ( ) . map ( VmNetworkInterface :: getNetworkName ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; } return cachedInterfaceNetworkNames ; }
Source:
public void testUpdateFieldsNameInStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; src.setInterfaces ( new java.util.ArrayList < > ( 2 ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names" , org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsNameInStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; src.setInterfaces ( new java.util.ArrayList < > ( 2 ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names" , vmHandler.isUpdateValid ( src , dest ) ) ; }
Source:
private void applyOnAttachmentParamsFrom ( org.ovirt.engine.ui.uicommonweb.models.hosts.InterfacePropertiesAccessor interfacePropertiesAccessor , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModelParametersHelper.populateIpv4Details ( interfacePropertiesAccessor , networkAttachment.getIpConfiguration ( ) . getIpv4PrimaryAddress ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModelParametersHelper.populateIpv6Details ( interfacePropertiesAccessor , networkAttachment.getIpConfiguration ( ) . getIpv6PrimaryAddress ( ) ) ; if ( interfacePropertiesAccessor.isQosOverridden ( ) ) { org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos anonymousHostNetworkQos = org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos.fromHostNetworkQos ( interfacePropertiesAccessor.getHostNetworkQos ( ) ) ; networkAttachment.setHostNetworkQos ( anonymousHostNetworkQos ) ; } networkAttachment.setProperties ( interfacePropertiesAccessor.getCustomProperties ( ) ) ; }

Target:
private void applyOnAttachmentParamsFrom ( org.ovirt.engine.ui.uicommonweb.models.hosts.InterfacePropertiesAccessor interfacePropertiesAccessor , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModelParametersHelper.populateIpv4Details ( interfacePropertiesAccessor , networkAttachment.getIpConfiguration ( ) . getIpv4PrimaryAddress ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModelParametersHelper.populateIpv6Details ( interfacePropertiesAccessor , networkAttachment.getIpConfiguration ( ) . getIpv6PrimaryAddress ( ) ) ; if ( interfacePropertiesAccessor.isQosOverridden ( ) ) { org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos anonymousHostNetworkQos = org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos.fromHostNetworkQos ( interfacePropertiesAccessor.getHostNetworkQos ( ) ) ; networkAttachment.setHostNetworkQos ( anonymousHostNetworkQos ) ; } networkAttachment.setProperties ( interfacePropertiesAccessor.getCustomProperties ( ) ) ; networkAttachment.setDnsResolverConfiguration ( interfacePropertiesAccessor.getDnsResolverConfiguration ( ) ) ; }
Source:
private void setAndInvokeClient ( ) { vncImpl.setVncHost ( getHost ( ) ) ; vncImpl.setVncPort ( getPort ( ) ) ; vncImpl.setTicket ( getOtp64 ( ) ) ; vncImpl.setTitle ( getTitle ( ) ) ; vncImpl.invokeClient ( ) ; }

Target:
private void setAndInvokeClient ( ) { vncImpl.setVncHost ( getHost ( ) ) ; vncImpl.setVncPort ( getPort ( ) ) ; vncImpl.setTicket ( getOtp64 ( ) ) ; vncImpl.setTitle ( getTitle ( ) ) ; vncImpl.setTicketValiditySeconds ( org.ovirt.engine.ui.uicommonweb.models.vms.TICKET_VALIDITY_SECONDS ) ; vncImpl.invokeClient ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc validateStorageServerConnection ( int serverType , java.lang.String spUUID , java.util.Map < java.lang.String , java.lang.String > [ ] args ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.validateStorageServerConnection ( serverType , spUUID , args ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionStatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotUnplugNic ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotunplugNic ( info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private org.ovirt.engine.ui.uicommonweb.ReportCommand addOpenReportCommand ( org.ovirt.engine.ui.uicommonweb.ReportCommand reportCommand ) { if ( openReportCommands.add ( reportCommand ) ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > items = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.IVdcQueryable > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ( ) ; updateReportCommandAvailability ( reportCommand , items ) ; return reportCommand ; } else { return null ; } }

Target:
private org.ovirt.engine.ui.uicommonweb.ReportCommand addOpenReportCommand ( org.ovirt.engine.ui.uicommonweb.ReportCommand reportCommand ) { if ( openReportCommands.add ( reportCommand ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > items = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.IVdcQueryable > cast ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ( ) ; updateReportCommandAvailability ( reportCommand , items ) ; return reportCommand ; } else { return null ; } }
Source:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; updateVmConfigurationBySnapshot ( snapshot.getId ( ) ) ; } }

Target:
private void setMemorySnapshotSupported ( boolean value ) { if ( ( memorySnapshotSupported ) != value ) { memorySnapshotSupported = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsMemorySnapshotSupported" ) ) ; } }
Source:
private static void addCdDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.add ( VdsProperties.Index , "2" ) ; struct.add ( VdsProperties.Iface , VdsProperties.Ide ) ; struct.add ( VdsProperties.ReadOnly , java.lang.Boolean.TRUE.toString ( ) ) ; }

Target:
private static void addCdDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.add ( VdsProperties.Index , "2" ) ; struct.add ( VdsProperties.Iface , VdsProperties.Ide ) ; struct.add ( VdsProperties.ReadOnly , java.lang.Boolean.TRUE.toString ( ) ) ; struct.add ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }
Source:
protected void initVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.PoweredDown ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDAO ( ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; mockGetVmsListForDisk ( ) ; }

Target:
protected void initVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDAO ( ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; mockGetVmsListForDisk ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdsActionParameters parameters = new org.ovirt.engine.core.common.action.VdsActionParameters ( getVdsId ( ) ) ; parameters.setLockProperties ( org.ovirt.engine.core.common.action.LockProperties.create ( LockProperties.Scope.Execution ) . withWait ( isInternalExecution ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.RefreshHostCapabilities , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { return ; } returnValue = runInternalAction ( ActionType.RefreshHostDevices , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { return ; } setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdsActionParameters parameters = new org.ovirt.engine.core.common.action.VdsActionParameters ( getVdsId ( ) ) ; parameters.setLockProperties ( org.ovirt.engine.core.common.action.LockProperties.create ( LockProperties.Scope.Execution ) . withWait ( isInternalExecution ( ) ) ) ; org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalAction ( ActionType.RefreshHostCapabilities , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { return ; } returnValue = runInternalAction ( ActionType.RefreshHostDevices , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { return ; } setSucceeded ( true ) ; }
Source:
private void updateOption ( org.ovirt.engine.core.common.businessentities.VdcOption option ) { java.util.Map < java.lang.String , java.lang.Object > values = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( option.getOptionName ( ) ) ; if ( values == null ) { values = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.put ( option.getOptionName ( ) , values ) ; } values.put ( option.getVersion ( ) , getValue ( option ) ) ; }

Target:
private void updateOption ( org.ovirt.engine.core.common.businessentities.VdcOption option ) { java.util.Map < java.lang.String , java.lang.Object > values = _vdcOptionCache.get ( option.getOptionName ( ) ) ; if ( values == null ) { values = new java.util.HashMap < > ( ) ; _vdcOptionCache.put ( option.getOptionName ( ) , values ) ; } values.put ( option.getVersion ( ) , getValue ( option ) ) ; }
Source:
public final boolean IsUpdateValid ( java.lang.Object source , java.lang.Object destination , java.lang.Enum < ? > status , boolean hotsetEnabled ) { if ( ( source.getClass ( ) ) != ( destination.getClass ( ) ) ) { return false ; } for ( java.lang.String fieldName : org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( source , destination ) ) { if ( ! ( IsFieldUpdatable ( status , fieldName , null , hotsetEnabled ) ) ) { org.ovirt.engine.core.utils.ObjectIdentityChecker.log.warn ( java.lang.String.format ( "ObjectIdentityChecker.IsUpdateValid:: Not updatable field '%1$s' was updated" , fieldName ) ) ; return false ; } } return true ; }

Target:
public final boolean IsUpdateValid ( java.lang.Object source , java.lang.Object destination , java.lang.Enum < ? > status , boolean hotsetEnabled ) { if ( ( source.getClass ( ) ) != ( destination.getClass ( ) ) ) { return false ; } for ( java.lang.String fieldName : org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( source , destination ) ) { if ( ! ( IsFieldUpdatable ( status , fieldName , null , hotsetEnabled ) ) ) { org.ovirt.engine.core.utils.ObjectIdentityChecker.log.warn ( "ObjectIdentityChecker.IsUpdateValid:: Not updatable field '{}' was updated" , fieldName ) ; return false ; } } return true ; }
Source:
private boolean allowedNetworkLabelManipulation ( ) { boolean labelNotChanged = ! ( labelChanged ( ) ) ; return ( ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . isExternal ( ) ) ) && ( labelNotChanged || ( labelAdded ( ) ) ) ; }

Target:
private boolean allowedNetworkLabelManipulation ( ) { boolean labelNotChanged = ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.labelChanged ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ) ; return ( ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . isExternal ( ) ) ) && ( labelNotChanged || ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.labelAdded ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc refreshStoragePool ( java.lang.String spUUID , java.lang.String msdUUID , int masterVersion ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.refreshStoragePool ( spUUID , msdUUID , masterVersion ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc add_image_ticket ( java.lang.String ticketId , java.lang.String [ ] ops , long timeout , long size , java.lang.String url ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.add_image_ticket ( ticketId , ops , timeout , size , url ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void updateActionAvailability ( ) { java.util.List < ? > items = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : java.util.Collections.emptyList ( ) ; for ( org.ovirt.engine.ui.uicommonweb.ReportCommand reportCommand : openReportCommands ) { updateReportCommandAvailability ( reportCommand , items ) ; } }

Target:
private void updateActionAvailability ( ) { java.util.List < ? > items = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.getSelectedItems ( ) : java.util.Collections.emptyList ( ) ; for ( org.ovirt.engine.ui.uicommonweb.ReportCommand reportCommand : openReportCommands ) { updateReportCommandAvailability ( reportCommand , items ) ; } }
Source:
private void initSelectionGeustAgentData ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface selectedItem ) { if ( ( selectedItem == null ) || ( ( getGuestAgentData ( ) ) == null ) ) { setSelectionGuestAgentData ( null ) ; return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > selectionInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface guestInterface : getGuestAgentData ( ) ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( guestInterface.getMacAddress ( ) , selectedItem.getMacAddress ( ) ) ) { selectionInterfaces.add ( guestInterface ) ; } } setSelectionGuestAgentData ( selectionInterfaces ) ; }

Target:
private void initSelectionGeustAgentData ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface selectedItem ) { if ( ( selectedItem == null ) || ( ( getGuestAgentData ( ) ) == null ) ) { setSelectionGuestAgentData ( null ) ; return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > selectionInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface guestInterface : getGuestAgentData ( ) ) { if ( java.util.Objects.equals ( guestInterface.getMacAddress ( ) , selectedItem.getMacAddress ( ) ) ) { selectionInterfaces.add ( guestInterface ) ; } } setSelectionGuestAgentData ( selectionInterfaces ) ; }
Source:
public void testGroups ( ) { org.ovirt.engine.core.compat.Match match = org.ovirt.engine.core.compat.Regex.Match ( "ABC,123" , "([A-Z]+),([0-9]+)" ) ; org.junit.Assert.assertEquals ( "First Group" , "ABC" , match.groups ( ) . get ( 0 ) . getValue ( ) ) ; org.junit.Assert.assertEquals ( "Second Group" , "123" , match.groups ( ) . get ( 1 ) . getValue ( ) ) ; }

Target:
public void testGroups ( ) { org.ovirt.engine.core.compat.Match match = org.ovirt.engine.core.compat.Regex.match ( "ABC,123" , "([A-Z]+),([0-9]+)" ) ; org.junit.Assert.assertEquals ( "First Group" , "ABC" , match.groups ( ) . get ( 0 ) . getValue ( ) ) ; org.junit.Assert.assertEquals ( "Second Group" , "123" , match.groups ( ) . get ( 1 ) . getValue ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getVdsInterfaces ( org.ovirt.engine.core.compat.Guid vdsId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces = getInterfaceDAO ( ) . getAllInterfacesForVds ( vdsId ) ; return interfaces == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) : interfaces ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getNewUpServer ( org.ovirt.engine.core.common.businessentities.VDS upServer ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getVdsDAO ( ) . getAllForVdsGroupWithStatus ( getVdsGroupId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.common.businessentities.VDS newUpServer = null ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdsList ) { if ( ( ! ( getVdsId ( ) . equals ( vds.getId ( ) ) ) ) && ( ! ( upServer.getId ( ) . equals ( vds.getId ( ) ) ) ) ) { newUpServer = vds ; break ; } } return newUpServer ; }
Source:
protected boolean canDoAction ( ) { java.util.List < java.lang.String > canDoActionMessages = getReturnValue ( ) . getCanDoActionMessages ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; if ( ! ( canDoAction_beforeCloneVm ( canDoActionMessages , domainsMap ) ) ) { return failCanDoActionWithType ( ) ; } if ( getParameters ( ) . isImportAsNewEntity ( ) ) { initImportClonedVm ( ) ; } if ( ! ( canDoAction_afterCloneVm ( canDoActionMessages , domainsMap ) ) ) { return failCanDoActionWithType ( ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; if ( ! ( canDoActionBeforeCloneVm ( domainsMap ) ) ) { return false ; } if ( getParameters ( ) . isImportAsNewEntity ( ) ) { initImportClonedVm ( ) ; } return canDoActionAfterCloneVm ( domainsMap ) ; }
Source:
private void setupGetNetworkExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getNetworksModel ( ) ) ; } }

Target:
private void setupGetNetworkExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getNetworksModel ( ) ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks = computeLabelChanges ( bondDialogModel.getLabelsModel ( ) , nicMap.get ( entity.getName ( ) ) . getItems ( ) ) ; if ( validateLabelChanges ( potentialNetworks ) ) { setBondOptions ( entity , bondDialogModel ) ; commitLabelChanges ( bondDialogModel.getLabelsModel ( ) , entity , potentialNetworks ) ; redraw ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.PfNicLabelModel labelsModel = bondDialogModel.getLabelsModel ( ) ; if ( computeAndCommitLabelChanges ( entity , labelsModel ) ) { setBondOptions ( entity , bondDialogModel ) ; } }
Source:
public void canDoActionMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; org.ovirt.engine.core.compat.Guid templateImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; diskImage.setImageTemplateId ( templateImageId ) ; initDiskImage ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , templateImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }

Target:
public void validateMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; org.ovirt.engine.core.compat.Guid templateImageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; diskImage.setImageTemplateId ( templateImageId ) ; initDiskImage ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , templateImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; getBackend ( ) . EndAction ( getImagesActionType ( ) , p ) ; } }

Target:
private void addVnic ( org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) , getParameters ( ) . isImportAsNewEntity ( ) , getVdsGroup ( ) . getcompatibility_version ( ) ) ; macsAdded.add ( iface.getMacAddress ( ) ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( outAverageLinkshare ) == null ? 0 : outAverageLinkshare.hashCode ( ) ) ; result = ( prime * result ) + ( ( outAverageRealtime ) == null ? 0 : outAverageRealtime.hashCode ( ) ) ; result = ( prime * result ) + ( ( outAverageUpperlimit ) == null ? 0 : outAverageUpperlimit.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( super . hashCode ( ) , outAverageLinkshare , outAverageRealtime , outAverageUpperlimit ) ; }
Source:
public void testHasPeersFalse ( ) { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.any ( java.util.Set.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML_NO_PEERS ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.junit.Assert.assertTrue ( glusterUtil.getPeers ( client ) . isEmpty ( ) ) ; }

Target:
public void testHasPeersFalse ( ) { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.anySetOf ( java.lang.String.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML_NO_PEERS ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.junit.Assert.assertTrue ( glusterUtil.getPeers ( client ) . isEmpty ( ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return 262144 ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < ? > ) ( source ) ) ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }
Source:
protected org.ovirt.engine.api.model.NIC populate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.Network network = findNetwork ( model ) ; model.getNetwork ( ) . setId ( network.getId ( ) . toString ( ) ) ; model.getNetwork ( ) . setName ( null ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.NIC deprecatedPopulate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.network.Network network = findNetwork ( model ) ; if ( network != null ) { model.getNetwork ( ) . setId ( network.getId ( ) . toString ( ) ) ; model.getNetwork ( ) . setName ( null ) ; } return model ; }
Source:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( getSucceeded ( ) ) { if ( errors.isEmpty ( ) ) { return org.ovirt.engine.core.common.AuditLogType.GLUSTER_HOOK_ENABLE ; } else { return org.ovirt.engine.core.common.AuditLogType.GLUSTER_HOOK_ENABLE_PARTIAL ; } } else { return ( errorType ) == null ? org.ovirt.engine.core.common.AuditLogType.GLUSTER_HOOK_ENABLE_FAILED : errorType ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand.getSucceeded ( ) ) { if ( errors.isEmpty ( ) ) { return org.ovirt.engine.core.common.AuditLogType.GLUSTER_HOOK_ENABLE ; } else { return org.ovirt.engine.core.common.AuditLogType.GLUSTER_HOOK_ENABLE_PARTIAL ; } } else { return ( errorType ) == null ? org.ovirt.engine.core.common.AuditLogType.GLUSTER_HOOK_ENABLE_FAILED : errorType ; } }
Source:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void GetDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > getInheritedPermissions ( ) { ( ( org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ) ( queryParams ) ) . setVdcObjectType ( objectType ) ; ( ( org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ) ( queryParams ) ) . setDirectOnly ( false ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > inheritedPermissions = getBackendCollection ( queryType , queryParams ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions entity : inheritedPermissions ) { if ( ( objectType ) != null ) { entity.setObjectType ( objectType ) ; entity.setObjectId ( targetId ) ; } } return inheritedPermissions ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Permission > getInheritedPermissions ( ) { ( ( org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ) ( queryParams ) ) . setVdcObjectType ( objectType ) ; ( ( org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ) ( queryParams ) ) . setDirectOnly ( false ) ; java.util.List < org.ovirt.engine.api.model.Permission > inheritedPermissions = getBackendCollection ( queryType , queryParams ) ; for ( org.ovirt.engine.api.model.Permission entity : inheritedPermissions ) { if ( ( objectType ) != null ) { entity.setObjectType ( objectType ) ; entity.setObjectId ( targetId ) ; } } return inheritedPermissions ; }
Source:
public void getVmTemplatesByBaseTemplateId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid baseTemplate ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByBaseTemplateId , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( baseTemplate ) , asyncQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
public void testUpdateEmulatedMachine ( ) { java.lang.String preUpdate = existingVdsGroup.getEmulatedMachine ( ) ; java.lang.String updatedValue = "pc-version-1.2.3" ; org.junit.Assert.assertNotSame ( preUpdate , updatedValue ) ; existingVdsGroup.setEmulatedMachine ( updatedValue ) ; dao.setEmulatedMachine ( existingVdsGroup.getId ( ) , updatedValue ) ; org.junit.Assert.assertEquals ( updatedValue , dao.get ( existingVdsGroup.getId ( ) ) . getEmulatedMachine ( ) ) ; }

Target:
public void testSetEmulatedMachine ( ) { java.lang.String preUpdate = existingVdsGroup.getEmulatedMachine ( ) ; java.lang.String updatedValue = "pc-version-1.2.3" ; org.junit.Assert.assertNotSame ( preUpdate , updatedValue ) ; existingVdsGroup.setEmulatedMachine ( updatedValue ) ; dao.setEmulatedMachine ( existingVdsGroup.getId ( ) , updatedValue , false ) ; org.junit.Assert.assertEquals ( updatedValue , dao.get ( existingVdsGroup.getId ( ) ) . getEmulatedMachine ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlanDevice ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.network.Vlan ( ) ; vlan.setNetworkName ( network.getName ( ) ) ; vlan.setVdsId ( nic.getVdsId ( ) ) ; vlan.setName ( org.ovirt.engine.core.utils.NetworkUtils.constructVlanDeviceName ( nic , network ) ) ; vlan.setVlanId ( network.getVlanId ( ) ) ; vlan.setBaseInterface ( nic.getName ( ) ) ; vlan.setBootProtocol ( NetworkBootProtocol.NONE ) ; return vlan ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createAndConfigureVlanDevice ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.Network network , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingInterfaces ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = createVlanDevice ( org.ovirt.engine.core.utils.NetworkUtils.constructVlanDeviceName ( nic , network ) , existingInterfaces ) ; vlan.setNetworkName ( network.getName ( ) ) ; vlan.setVdsId ( nic.getVdsId ( ) ) ; vlan.setVlanId ( network.getVlanId ( ) ) ; vlan.setBaseInterface ( nic.getName ( ) ) ; vlan.setBootProtocol ( NetworkBootProtocol.NONE ) ; return vlan ; }
Source:
public void testAddUser3 ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetDomainList , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; setUpAddUserExpectations ( ( ( ( "ADUSER@" + ( DOMAIN ) ) + ":: username=" ) + ( NAMES [ 0 ] ) ) ) ; org.ovirt.engine.api.model.User model = new org.ovirt.engine.api.model.User ( ) ; model.setUserName ( ( ( ( NAMES [ 0 ] ) + "@" ) + ( DOMAIN ) ) ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; verifyAddUser ( response ) ; }

Target:
public void testAddUser3 ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetDomainList , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; setUpAddUserExpectations ( ( ( ( "ADUSER@" + ( DOMAIN ) ) + ":: username=" ) + ( NAMES [ 0 ] ) ) ) ; org.ovirt.engine.api.model.User model = new org.ovirt.engine.api.model.User ( ) ; model.setUserName ( ( ( ( NAMES [ 0 ] ) + "@" ) + ( DOMAIN ) ) ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; verifyAddUser ( response ) ; }
Source:
private static void GetVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParanet , new org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private static void GetVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.SchedulingPolicies mapCollection ( java.util.List < org.ovirt.engine.core.common.scheduling.ClusterPolicy > entities ) { org.ovirt.engine.api.model.SchedulingPolicies collection = new org.ovirt.engine.api.model.SchedulingPolicies ( ) ; for ( org.ovirt.engine.core.common.scheduling.ClusterPolicy entity : entities ) { collection.getSchedulingPolicy ( ) . add ( addLinks ( populate ( map ( entity ) , entity ) ) ) ; } return collection ; }

Target:
protected org.ovirt.engine.api.model.SchedulingPolicies mapCollection ( java.util.List < org.ovirt.engine.core.common.scheduling.ClusterPolicy > entities ) { org.ovirt.engine.api.model.SchedulingPolicies collection = new org.ovirt.engine.api.model.SchedulingPolicies ( ) ; for ( org.ovirt.engine.core.common.scheduling.ClusterPolicy entity : entities ) { collection.getSchedulingPolicies ( ) . add ( addLinks ( populate ( map ( entity ) , entity ) ) ) ; } return collection ; }
Source:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; } else if ( ! ( vmDisksToAttach.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , attemptToAttachDisksToImportedVm ( vmDisksToAttach ) ) ; } } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getId ( ) ) ; }

Target:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESSFULLY ) ; } else if ( ! ( vmDisksToAttach.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , attemptToAttachDisksToImportedVm ( vmDisksToAttach ) ) ; } } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getId ( ) ) ; }