auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void SelectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.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:
protected org.ovirt.engine.core.common.businessentities.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.aaa.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbGroup entity = new org.ovirt.engine.core.common.businessentities.aaa.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }
Source:
public void shouldPass ( ) throws java.lang.Exception { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ) ; options.setVmId ( Guid.Empty ) ; org.ovirt.engine.core.common.queries.ConsoleOptionsParams params = new org.ovirt.engine.core.common.queries.ConsoleOptionsParams ( options ) ; org.ovirt.engine.core.bll.GetConsoleDescriptorFileQuery query = new org.ovirt.engine.core.bll.GetConsoleDescriptorFileQuery ( params ) ; org.junit.Assert.assertTrue ( query.validateInputs ( ) ) ; }

Target:
public void shouldPass ( ) throws java.lang.Exception { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ) ; options.setVmId ( Guid.Empty ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( options ) ; org.junit.Assert.assertTrue ( getQuery ( ) . validateInputs ( ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml html = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ; sb.appendHtmlConstant ( ( ( ( ( ( "<div title=\"" + ( title ) ) + "\" " ) + "style=\"" ) + ( style ) ) + "\">" ) ) ; sb.append ( html ) ; sb.appendHtmlConstant ( "</div>" ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.column.StyledImageResourceCell.template.imageContainer ( title , style , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }
Source:
private java.lang.String getVmIsBeingImportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED.name ( ) ) ; if ( ( getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , getVmName ( ) ) ) ; } return builder.toString ( ) ; }

Target:
private java.lang.String getVmIsBeingImportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.ImportVmCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.ImportVmCommand.getVmName ( ) ) ) ; } return builder.toString ( ) ; }
Source:
protected void setUpEntityQueryExpectations ( java.lang.String failure ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 3 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , entities , failure ) ; }

Target:
protected void setUpEntityQueryExpectations ( java.lang.String failure ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } setUpEntityQueryExpectations ( QueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 3 ] , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All } , entities , failure ) ; }
Source:
protected void updateStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { log.infoFormat ( "Setting domain %s to status $s" , map.getId ( ) , status.name ( ) ) ; map.setstatus ( status ) ; getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; }

Target:
protected void updateStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { log.infoFormat ( "Setting domain %s to status $s" , map.getId ( ) , status.name ( ) ) ; map.setStatus ( status ) ; getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotListModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotListModel ) ( result.getState ( ) ) ) ; localModel.stopProgress ( ) ; localModel.postSnapshotAction ( result.getReturnValue ( ) ) ; }

Target:
public void onEditSnapshotSchedule ( ) { final org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotModel ) ( getWindow ( ) ) ) ; if ( ( snapshotModel.getRecurrence ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN ) ) { confirmDeleteVolumeSnapshotSchedule ( ) ; } else { onEditSnapshotScheduleInternal ( ) ; } }
Source:
public void setup ( ) { command.setCluster ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void setup ( ) { command.setCluster ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }

Target:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }
Source:
public void testStorageDomainVmLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; vm.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; vm.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; vm = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( vm ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_VM_HREF , vm.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , vm.getStorageDomain ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainVmLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; vm.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; vm.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; vm = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( vm ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_VM_HREF , vm.getHref ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , vm.getStorageDomain ( ) . getHref ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage mockSourceImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.when ( diskImageDAO.get ( image.getImageId ( ) ) ) . thenReturn ( image ) ; return image ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage mockSourceImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.when ( diskImageDAO.get ( image.getImageId ( ) ) ) . thenReturn ( image ) ; return image ; }
Source:
public void localStoragePoolAttachedToSingleCluster ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.mockito.Mockito.when ( dataCenter.isLocal ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( dataCenter ) ; org.junit.Assert.assertThat ( validator.localStoragePoolAttachedToSingleCluster ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void localStoragePoolAttachedToSingleCluster ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.mockito.Mockito.when ( dataCenter.isLocal ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( dataCenter ) ; org.hamcrest.MatcherAssert.assertThat ( validator.localStoragePoolAttachedToSingleCluster ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private java.lang.Integer calcMaxVCpu ( ) { java.lang.Integer maxSockets = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmSockets , vm.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; java.lang.Integer maxVCpus = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmCpus , vm.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; maxVCpus = ( vm.getCpuPerSocket ( ) ) * ( java.lang.Math.min ( maxSockets , ( maxVCpus / ( vm.getCpuPerSocket ( ) ) ) ) ) ; return maxVCpus ; }

Target:
private java.lang.Integer calcMaxVCpu ( ) { java.lang.Integer maxSockets = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmSockets , vm.getCompatibilityVersion ( ) . getValue ( ) ) ; java.lang.Integer maxVCpus = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumOfVmCpus , vm.getCompatibilityVersion ( ) . getValue ( ) ) ; int threadsPerCore = vm.getThreadsPerCpu ( ) ; int cpuPerSocket = vm.getCpuPerSocket ( ) ; maxVCpus = ( cpuPerSocket * threadsPerCore ) * ( java.lang.Math.min ( maxSockets , ( maxVCpus / ( cpuPerSocket * threadsPerCore ) ) ) ) ; return maxVCpus ; }
Source:
protected void updateManagedDeviceMap ( org.ovirt.engine.core.common.businessentities.DiskImage disk , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > managedDeviceMap ) { org.ovirt.engine.core.compat.Guid oldDiskId = newDiskIdForDisk.get ( disk.getId ( ) ) . getId ( ) ; managedDeviceMap.put ( disk.getId ( ) , managedDeviceMap.get ( oldDiskId ) ) ; managedDeviceMap.remove ( oldDiskId ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid generateNewDiskId ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.compat.Guid newGuidForDisk = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; newDiskIdForDisk.put ( newGuidForDisk , org.ovirt.engine.core.common.businessentities.storage.DiskImage.copyOf ( disk ) ) ; disk.setId ( newGuidForDisk ) ; disk.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return newGuidForDisk ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void diskInterfaceNotSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; vm.setVmOs ( 2 ) ; initializeOsRepository ( vm.getOs ( ) , DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; }

Target:
public void diskInterfaceNotSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; vm.setVmOs ( 2 ) ; initializeOsRepository ( vm.getOs ( ) , DiskInterface.VirtIO ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm , dve ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; }
Source:
private org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage createMacsStorage ( java.util.Collection < org.apache.commons.lang.math.LongRange > rangesBoundaries ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage ( allowDuplicates ) ; for ( org.apache.commons.lang.math.LongRange range : rangesBoundaries ) { macsStorage.addRange ( range.getMinimumLong ( ) , range.getMaximumLong ( ) ) ; } if ( macsStorage.availableMacExist ( ) ) { return macsStorage ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.MAC_POOL_INITIALIZATION_FAILED ) ; } }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacsStorage createMacsStorage ( java.util.Collection < org.apache.commons.lang.math.LongRange > rangesBoundaries ) { org.ovirt.engine.core.bll.network.macpool.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpool.MacsStorage ( allowDuplicates ) ; for ( org.apache.commons.lang.math.LongRange range : rangesBoundaries ) { macsStorage.addRange ( range.getMinimumLong ( ) , range.getMaximumLong ( ) ) ; } if ( macsStorage.availableMacExist ( ) ) { return macsStorage ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.MAC_POOL_INITIALIZATION_FAILED ) ; } }
Source:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( Ipv4BootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpv4Configuration ( Ipv4BootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.ArchitectureType getArchitecture ( ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( getVdsGroup ( ) . getCpuName ( ) ) ) { return org.ovirt.engine.core.bll.VdsGroupOperationCommandBase.getCpuFlagsManagerHandler ( ) . getArchitectureByCpuName ( getVdsGroup ( ) . getCpuName ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; } else if ( ( getVdsGroup ( ) . getArchitecture ( ) ) == null ) { return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; } return getVdsGroup ( ) . getArchitecture ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.ArchitectureType getArchitecture ( ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( getCluster ( ) . getCpuName ( ) ) ) { return org.ovirt.engine.core.bll.ClusterOperationCommandBase.getCpuFlagsManagerHandler ( ) . getArchitectureByCpuName ( getCluster ( ) . getCpuName ( ) , getCluster ( ) . getCompatibilityVersion ( ) ) ; } else if ( ( getCluster ( ) . getArchitecture ( ) ) == null ) { return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; } return getCluster ( ) . getArchitecture ( ) ; }
Source:
public boolean isSkipped ( ) { if ( ( ( getReturnValue ( ) ) != null ) && ( ( getReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ) { org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue fenceStatus = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( getReturnValue ( ) ) ) ; return fenceStatus.getIsSkipped ( ) ; } else { return false ; } }

Target:
public boolean isSkippedDueToStatus ( ) { if ( ( ( getReturnValue ( ) ) != null ) && ( ( getReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ) { org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue fenceStatus = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( getReturnValue ( ) ) ) ; return fenceStatus.getIsSkippedDueToStatus ( ) ; } else { return false ; } }
Source:
private static java.lang.String getVMRegexString ( org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter search ) { java.lang.StringBuilder query = new java.lang.StringBuilder ( ) ; query.append ( ".*" ) . append ( search.getDefaultSort ( SearchObjects.VM_OBJ_NAME ) ) . append ( ".*" ) . append ( search.getRelatedTableNameWithOutTags ( SearchObjects.VM_OBJ_NAME ) ) . append ( ".* " ) ; return query.toString ( ) ; }

Target:
private static java.lang.String getVMRegexString ( org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter search ) { java.lang.StringBuilder query = new java.lang.StringBuilder ( ) ; query.append ( ".*" ) . append ( search.getDefaultSort ( SearchObjects.VM_OBJ_NAME ) ) . append ( ".*" ) . append ( search.getRelatedTableName ( SearchObjects.VM_OBJ_NAME , false ) ) . append ( ".* " ) ; return query.toString ( ) ; }
Source:
private void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = vm.getStaticData ( ) ; vmStatic.setImages ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; vmStatic.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; org.ovirt.engine.core.bll.ImportUtils.updateGraphicsDevices ( vmStatic , org.ovirt.engine.core.bll.ConvertVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( vmStatic , false ) ; }

Target:
private void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = vm.getStaticData ( ) ; vmStatic.setImages ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; vmStatic.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; org.ovirt.engine.core.bll.ImportUtils.updateGraphicsDevices ( vmStatic , org.ovirt.engine.core.bll.ConvertVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( vmStatic , false ) ; org.ovirt.engine.core.bll.ConvertVmCommand.getVmDeviceDao ( ) . updateBootOrderInBatch ( new java.util.ArrayList ( vm.getManagedVmDeviceMap ( ) . values ( ) ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_NAME , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }

Target:
private java.lang.String getVmIsBeingImportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.ImportVmCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.ImportVmCommand.getVmName ( ) ) ) ; } return builder.toString ( ) ; }
Source:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_RETURN_VALUE ) , new java.lang.Object [ ] { org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) } ) ; }

Target:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.ArgumentMatchers.eq ( LoggedUtils.EXIT_LOG_RETURN_VALUE ) , new java.lang.Object [ ] { org.mockito.ArgumentMatchers.anyObject ( ) , org.mockito.ArgumentMatchers.anyObject ( ) , org.mockito.ArgumentMatchers.eq ( id ) } ) ; }
Source:
protected void initUser ( ) { }

Target:
protected org.ovirt.engine.core.bll.UpdateVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolParameters param = new org.ovirt.engine.core.common.action.AddVmPoolParameters ( vmPools , testVm , VM_COUNT ) ; param.setStorageDomainId ( firstStorageDomainId ) ; return org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmPoolCommand ( param , org.ovirt.engine.core.bll.context.CommandContext.createContext ( param.getSessionId ( ) ) ) ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getPluggedManagedInterfaces ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( ( ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isHostDevInterface ( device ) ) || ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBridge ( device ) ) ) && ( device.getIsPlugged ( ) ) ) && ( device.getIsManaged ( ) ) ) { result.add ( device ) ; } } return result ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getPluggedManagedInterfaces ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmDevice > devices ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( ( ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isHostDevInterface ( device ) ) || ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBridge ( device ) ) ) && ( device.isPlugged ( ) ) ) && ( device.isManaged ( ) ) ) { result.add ( device ) ; } } return result ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public void checkDifferentSubnetIntegerAndStringRepresentation ( ) { org.mockito.Mockito.when ( mockedMaskValidator.isValidNetmaskFormat ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.VALID_NETMASK_FORMAT ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( mockedMaskValidator.isPrefixValid ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.DIFFERENT_PREFIX ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( mockIpAddressConverter.convertPrefixToNetmask ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.DIFFERENT_PREFIX ) ) . thenReturn ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.INVALID_NETMASK_FORMAT ) ; org.junit.Assert.assertFalse ( underTest.equalSubnet ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.DIFFERENT_PREFIX , org.ovirt.engine.core.common.utils.SubnetUtilsTest.VALID_NETMASK_FORMAT ) ) ; }

Target:
public void checkDifferentSubnetIntegerAndStringRepresentation ( ) { org.mockito.Mockito.when ( mockedMaskValidator.isValidNetmaskFormat ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.VALID_NETMASK_FORMAT ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( mockedMaskValidator.isPrefixValid ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.DIFFERENT_PREFIX ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( mockIpAddressConverter.convertPrefixToNetmask ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.DIFFERENT_PREFIX ) ) . thenReturn ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.INVALID_NETMASK_FORMAT ) ; org.junit.jupiter.api.Assertions.assertFalse ( underTest.equalSubnet ( org.ovirt.engine.core.common.utils.SubnetUtilsTest.DIFFERENT_PREFIX , org.ovirt.engine.core.common.utils.SubnetUtilsTest.VALID_NETMASK_FORMAT ) ) ; }
Source:
protected boolean canDoAction ( ) { return ( ( ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( ( ( ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ) && ( virtIoScsiDiskValidation ( ) ) ; }
Source:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; UpdateIsDisksAvailable ( ) ; }

Target:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }
Source:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.UpdateVmDiskParameters ( vmId , diskImageGuid , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }

Target:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.UpdateVmDiskParameters ( vmId , diskImageGuid , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }
Source:
public void executeQueryCommandWithBaseSnapshotOnly ( ) { imagesIds.add ( image1.getImageId ( ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > queryReturnValue = runQuery ( ) ; org.junit.Assert.assertEquals ( 1 , queryReturnValue.size ( ) ) ; org.junit.Assert.assertEquals ( image1 , queryReturnValue.get ( image1.getImageId ( ) ) ) ; }

Target:
public void executeQueryCommandWithBaseSnapshotOnly ( ) { imagesIds.add ( image1.getImageId ( ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > queryReturnValue = runQuery ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , queryReturnValue.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( image1 , queryReturnValue.get ( image1.getImageId ( ) ) ) ; }
Source:
public void testNotManagementNetworkNegative ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotManagementNetworkNegative ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) . thenReturn ( false ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
com.google.gwt.user.cellview.client.Header < ? > createHeader ( com.google.gwt.user.cellview.client.Column < T , ? > column , java.lang.String headerTextOrHtml , boolean allowHtml ) { com.google.gwt.safehtml.shared.SafeHtml headerHtml = ( allowHtml ) ? com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( headerTextOrHtml ) : com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( headerTextOrHtml ) ; return createHeader ( column , headerHtml ) ; }

Target:
public void addColumnWithHtmlHeader ( com.google.gwt.user.cellview.client.Column < T , ? > column , com.google.gwt.safehtml.shared.SafeHtml headerHtml , java.lang.String width ) { com.google.gwt.user.cellview.client.Header < ? > header = new org.ovirt.engine.ui.common.widget.table.header.SafeHtmlHeader ( headerHtml ) ; addColumn ( column , header ) ; setColumnWidth ( column , width ) ; }
Source:
public void testIsHeHostWithVmCountGreaterThanZero ( ) { final int vmCount = 1 ; final boolean isHostedEngine = true ; setupHostedEngineTests ( isHostedEngine , vmCount ) ; boolean isHostedEngineHost = dao.get ( existingVds.getId ( ) ) . isHostedEngineHost ( ) ; org.junit.Assert.assertTrue ( isHostedEngineHost ) ; }

Target:
public void testIsHeHostWithVmCountGreaterThanZero ( ) { final int vmCount = 1 ; final boolean isHostedEngine = true ; setupHostedEngineTests ( isHostedEngine , vmCount ) ; boolean isHostedEngineHost = dao.get ( existingVds.getId ( ) ) . isHostedEngineHost ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( isHostedEngineHost ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetVmsInfo , buildGetVmsInfoParameters ( storage ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "StorageDomainName" , storage.getStorageName ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED ) ; throw e ; } }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetVmsInfo , buildGetVmsInfoParameters ( storage ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "StorageDomainName" , storage.getStorageName ( ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED ) ; throw e ; } }
Source:
public void testRemoveStorageConnectionFromIscsiBond ( ) { java.util.List < java.lang.String > connections = dao.getStorageConnectionIdsByIscsiBondId ( iscsiBondId ) ; connectionId = connections.get ( 0 ) ; dao.removeStorageConnectionFromIscsiBond ( iscsiBondId , connectionId ) ; connections = dao.getStorageConnectionIdsByIscsiBondId ( iscsiBondId ) ; junit.framework.Assert.assertEquals ( 1 , connections.size ( ) ) ; junit.framework.Assert.assertFalse ( connections.contains ( connectionId ) ) ; }

Target:
public void testRemoveStorageConnectionFromIscsiBond ( ) { java.util.List < java.lang.String > connections = dao.getStorageConnectionIdsByIscsiBondId ( iscsiBondId ) ; connectionId = connections.get ( 0 ) ; dao.removeStorageConnectionFromIscsiBond ( iscsiBondId , connectionId ) ; connections = dao.getStorageConnectionIdsByIscsiBondId ( iscsiBondId ) ; org.junit.Assert.assertEquals ( 1 , connections.size ( ) ) ; org.junit.Assert.assertFalse ( connections.contains ( connectionId ) ) ; }
Source:
public static void IsTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmTemlateWithSameNameExistParameters ( name ) , aQuery ) ; }

Target:
public static void GetCustomPropertiesList ( 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.util.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void IsMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigReset ( volumeName , slaveHost , slaveVolumeName , configKey ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepSessionList ( volumeName , slaveHost , slaveVolumeName , userName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters param = new org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters ( vmPools , testVm , VM_COUNT , DISK_SIZE ) ; param.setStorageDomainId ( firstStorageDomainId ) ; org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param ) { @ java.lang.Override protected void initTemplate ( ) { } } ) ; return command ; }

Target:
protected void initUser ( ) { }