auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND , org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NETWORK_INTERFACE_IS_NOT_BOND_ENTITY , bond.getName ( ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }

Target:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
public void testList ( ) throws java.lang.Exception { int numOfEntitiesInList = 2 ; setUpGetEntityExpectations ( QueryType.GetStorageServerConnectionExtensionsByHostId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionsResourceTest.hostID } , getEntityList ( numOfEntitiesInList ) ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.StorageConnectionExtension > retCollection = getCollection ( ) ; assertNotNull ( retCollection ) ; assertEquals ( numOfEntitiesInList , retCollection.size ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { int numOfEntitiesInList = 2 ; setUpGetEntityExpectations ( QueryType.GetStorageServerConnectionExtensionsByHostId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionsResourceTest.hostID } , getEntityList ( numOfEntitiesInList ) ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.StorageConnectionExtension > retCollection = getCollection ( ) ; org.junit.Assert.assertNotNull ( retCollection ) ; org.junit.Assert.assertEquals ( numOfEntitiesInList , retCollection.size ( ) ) ; }
Source:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > memoryStates = snapshotsManager.removeSnapshots ( vm.getId ( ) ) ; if ( ! ( memoryStates.isEmpty ( ) ) ) { new org.ovirt.engine.core.bll.memory.MemoryImageRemoverOnDataDomain ( vm , this ) . remove ( memoryStates ) ; } }

Target:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.errorFormat ( "Failed to remove memory volumes: {0}" , memoryVolume ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc heartBeat ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.ping" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc freeze ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.freeze" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }

Target:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( QueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }
Source:
public void importTemplate ( java.lang.String ovfstring , org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { org.ovirt.engine.core.utils.ovf.OvfReader ovf = null ; try { ovf = new org.ovirt.engine.core.utils.ovf.OvfTemplateReader ( new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( ovfstring ) , vmTemplate , images , interfaces ) ; buildOvf ( ovf ) ; initIcons ( vmTemplate ) ; } catch ( java.lang.Exception ex ) { java.lang.String message = generateOvfReaderErrorMessage ( ovf , ex ) ; logOvfLoadError ( message , ovfstring ) ; throw new org.ovirt.engine.core.utils.ovf.OvfReaderException ( message ) ; } }

Target:
public void importTemplate ( java.lang.String ovfstring , org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { org.ovirt.engine.core.utils.ovf.OvfReader ovf = null ; try { ovf = new org.ovirt.engine.core.utils.ovf.OvfTemplateReader ( new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( ovfstring ) , vmTemplate , images , interfaces ) ; ovf.build ( ) ; initIcons ( vmTemplate ) ; } catch ( java.lang.Exception ex ) { java.lang.String message = generateOvfReaderErrorMessage ( ovf , ex ) ; logOvfLoadError ( message , ovfstring ) ; throw new org.ovirt.engine.core.utils.ovf.OvfReaderException ( message ) ; } }
Source:
public static void getDataCenterMaxNameLength ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getStorageDomainMaxNameLength ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.String getText ( java.lang.Object image ) { if ( image instanceof org.ovirt.engine.core.common.businessentities.RepoImage ) { return ( ( org.ovirt.engine.core.common.businessentities.RepoImage ) ( image ) ) . getFileType ( ) . toString ( ) ; } return "(Unknown)" ; }

Target:
public java.lang.String getText ( java.lang.Object image ) { if ( image instanceof org.ovirt.engine.core.common.businessentities.RepoImage ) { return ( ( org.ovirt.engine.core.common.businessentities.RepoImage ) ( image ) ) . getFileType ( ) . toString ( ) ; } else if ( image instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { return ImageFileType.Disk.toString ( ) ; } return constants.unknown ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult qosExistsOrNull ( ) { return ( ( diskProfile.getQosId ( ) ) == null ) || ( ( getDbFacade ( ) . getQosDao ( ) . get ( diskProfile.getQosId ( ) ) ) != null ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult qosExistsOrNull ( ) { return ( ( getDiskProfile ( ) . getQosId ( ) ) == null ) || ( ( getDbFacade ( ) . getStorageQosDao ( ) . get ( getDiskProfile ( ) . getQosId ( ) ) ) != null ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_QOS_NOT_FOUND ) ; }
Source:
public org.ovirt.engine.api.model.User get ( ) { java.lang.String directoryId ; try { directoryId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( id ) ; } catch ( java.lang.IllegalArgumentException exception ) { throw new javax.ws.rs.WebApplicationException ( Response.Status.NOT_FOUND ) ; } java.lang.String directory = parent.getDirectory ( ) . getName ( ) ; org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directory , directoryId ) ; return performGet ( VdcQueryType.GetDirectoryUserById , parameters , org.ovirt.engine.api.model.BaseResource.class ) ; }

Target:
public org.ovirt.engine.api.model.User get ( ) { java.lang.String directoryId ; try { directoryId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( id ) ; } catch ( java.lang.IllegalArgumentException exception ) { throw new javax.ws.rs.WebApplicationException ( Response.Status.NOT_FOUND ) ; } java.lang.String directory = parent.getDirectory ( ) . getName ( ) ; org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directory , directoryId ) ; return performGet ( QueryType.GetDirectoryUserById , parameters , org.ovirt.engine.api.model.BaseResource.class ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > getBackendCollection ( ) { try { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( providerId ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( QueryType.GetAllExternalNetworksOnProvider , parameters ) ; if ( ! ( result.getSucceeded ( ) ) ) { backendFailure ( result.getExceptionString ( ) ) ; } return result.getReturnValue ( ) ; } catch ( java.lang.Exception exception ) { return handleError ( exception , false ) ; } }

Target:
private java.util.Map < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > getBackendCollection ( ) { try { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( providerId ) ) ; org.ovirt.engine.core.common.queries.QueryReturnValue result = runQuery ( QueryType.GetAllExternalNetworksOnProvider , parameters ) ; if ( ! ( result.getSucceeded ( ) ) ) { backendFailure ( result.getExceptionString ( ) ) ; } return result.getReturnValue ( ) ; } catch ( java.lang.Exception exception ) { return handleError ( exception , false ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeBrickAdd ( volumeName , bricks , replicaCount , stripeCount ) ; 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.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.verifyUntrustedVolume ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void onSuccess ( java.lang.Object innerModel , java.lang.Object innerReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( innerReturnValue ) ) . getReturnValue ( ) ; getStorageQuota ( ) . setItems ( quotas ) ; getStorageQuota ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( quotas ) ) ; }

Target:
public void onSuccess ( java.lang.Object innerModel , java.lang.Object innerReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( innerReturnValue ) ) . getReturnValue ( ) ; getStorageQuota ( ) . setItems ( quotas ) ; getStorageQuota ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( quotas ) ) ; }
Source:
public void testRangeCanContainOnlyIntSizeNumberOfElements ( ) { org.apache.commons.lang.math.LongRange longRange = org.ovirt.engine.core.utils.MacAddressRangeUtils.clipRange ( new org.apache.commons.lang.math.LongRange ( 0 , java.lang.Long.MAX_VALUE ) ) ; org.ovirt.engine.core.bll.network.macpool.Range range = new org.ovirt.engine.core.bll.network.macpool.Range ( longRange.getMinimumLong ( ) , longRange.getMaximumLong ( ) ) ; org.junit.Assert.assertThat ( range.getAvailableCount ( ) , org.hamcrest.CoreMatchers.is ( java.lang.Integer.MAX_VALUE ) ) ; }

Target:
public void testRangeCanContainOnlyIntSizeNumberOfElements ( ) { org.apache.commons.lang.math.LongRange longRange = org.ovirt.engine.core.utils.MacAddressRangeUtils.clipRange ( new org.apache.commons.lang.math.LongRange ( 0 , java.lang.Long.MAX_VALUE ) ) ; org.ovirt.engine.core.bll.network.macpool.Range range = new org.ovirt.engine.core.bll.network.macpool.Range ( longRange.getMinimumLong ( ) , longRange.getMaximumLong ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( range.getAvailableCount ( ) , org.hamcrest.CoreMatchers.is ( java.lang.Integer.MAX_VALUE ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.setVds ( null ) ; if ( ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) ) != null ) && ( shouldVdsBeFenced ( ) ) ) { super . executeCommand ( ) ; } else { org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.log.infoFormat ( "Not fencing host {0}({1}) since it's status is ok, or it doesn't exist anymore." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsId ( ) ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.setVds ( null ) ; if ( ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) ) != null ) && ( shouldVdsBeFenced ( ) ) ) { super . executeCommand ( ) ; } else { org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.log.infoFormat ( "Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsId ( ) ) ; } }
Source:
private void extractRemovedNetworks ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String net = iface.getNetworkName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( net ) ) && ( ! ( attachedNetworksNames.contains ( net ) ) ) ) { removedNetworks.add ( net ) ; } } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( params.getVdsId ( ) , removedNetworks ) ; for ( java.lang.String vmName : vmNames ) { addViolation ( VdcBllMessages.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , vmName ) ; } }

Target:
private void validateNotRemovingGlusterBrickNetworks ( ) { for ( java.lang.String network : removedNetworks ) { org.ovirt.engine.core.common.businessentities.network.Network removedNetwork = getExistingClusterNetworks ( ) . get ( network ) ; if ( ( removedNetwork == null ) || ( ! ( removedNetwork.getCluster ( ) . isGluster ( ) ) ) ) { continue ; } java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = glusterBrickDao.getAllByClusterAndNetworkId ( vds.getVdsGroupId ( ) , removedNetwork.getId ( ) ) ; if ( ! ( bricks.isEmpty ( ) ) ) { addViolation ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_NETWORK_FROM_BRICK , network ) ; } } }
Source:
public void vdspysGroupWithVirtGlusterNotSupported ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.GLUSTER_NOT_SUPPORTED ) ; }

Target:
public void shouldCheckIfClusterCanBeUpgraded ( ) { createCommandWithDefaultCluster ( ) ; cpuExists ( ) ; architectureIsUpdatable ( ) ; cmd.getCluster ( ) . setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; initAndAssertValidation ( true ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isUpgradePossible ( org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.anyList ( ) ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isUpgradeDone ( org.mockito.Matchers.anyList ( ) ) ; }
Source:
private void addViolation ( org.ovirt.engine.core.common.errors.EngineMessage violation , java.lang.String violatingEntity ) { java.util.List < java.lang.String > violatingEntities = violations.get ( violation ) ; if ( violatingEntities == null ) { violatingEntities = new java.util.ArrayList < > ( ) ; violations.put ( violation , violatingEntities ) ; } violatingEntities.add ( violatingEntity ) ; }

Target:
private void addViolation ( org.ovirt.engine.core.common.errors.EngineMessage violationMsg , java.lang.String violatingEntity ) { final org.ovirt.engine.core.utils.violation.Violation violation = ( ( org.ovirt.engine.core.utils.violation.Violation ) ( violations.get ( violationMsg ) ) ) ; if ( violation == null ) { violations.put ( violationMsg , new org.ovirt.engine.core.utils.violation.Violation ( violationMsg.name ( ) , violatingEntity ) ) ; } else { violation.add ( violatingEntity ) ; } }
Source:
public void setupMocks ( ) { setUpCommand ( ) ; mockGetStorageDomainList ( ) ; mockDbDao ( ) ; command.init ( ) ; }

Target:
public void setupMocks ( ) { setUpCommand ( ) ; mockGetStorageDomainList ( ) ; mockDbDao ( ) ; org.mockito.Mockito.when ( vmHandler.verifyMacPool ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( vmHandler.isVmPriorityValueLegal ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( true ) ; command.init ( ) ; }
Source:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void validateIsoPrefix ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; java.lang.String kernel = "kernel" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + initrd ) , ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + kernel ) ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + kernel ) ) ; }

Target:
public void validateIsoPrefix ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; java.lang.String kernel = "kernel" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( RunVmCommand.ISO_PREFIX ) + initrd ) , ( ( RunVmCommand.ISO_PREFIX ) + kernel ) ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + kernel ) ) ; }
Source:
protected boolean acquireLock ( ) { org.ovirt.engine.core.bll.LockIdNameAttribute annotation = getClass ( ) . getAnnotation ( org.ovirt.engine.core.bll.LockIdNameAttribute.class ) ; boolean returnValue = true ; if ( annotation != null ) { returnValue = acquireLockInternal ( ) ; } return returnValue ; }

Target:
protected boolean acquireLock ( ) { org.ovirt.engine.core.bll.LockIdNameAttribute annotation = getClass ( ) . getAnnotation ( org.ovirt.engine.core.bll.LockIdNameAttribute.class ) ; boolean returnValue = true ; if ( annotation != null ) { if ( ! ( annotation.isWait ( ) ) ) { returnValue = acquireLockInternal ( ) ; } else { acquireLockAndWait ( ) ; } } return returnValue ; }
Source:
protected org.ovirt.engine.core.common.businessentities.network lookupClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.util.List < org.ovirt.engine.core.common.businessentities.network > networks ) { for ( org.ovirt.engine.core.common.businessentities.network network : networks ) { if ( ( ( id != null ) && ( id.equals ( network.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( network.getname ( ) ) ) ) ) { return network ; } } return null ; }

Target:
protected org.ovirt.engine.api.model.Network lookupClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.util.List < org.ovirt.engine.api.model.Network > networks ) { for ( org.ovirt.engine.api.model.Network network : networks ) { if ( ( ( id != null ) && ( id.equals ( network.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( network.getname ( ) ) ) ) ) { return network ; } } return null ; }
Source:
private void validateAndExpectViolation ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.errors.VdcBllMessages violation ) { java.util.List < java.lang.String > violations = helper.validate ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected violation {0} but only got {1}." , violation , violations ) , violations.contains ( violation.name ( ) ) ) ; }

Target:
private void validateAndExpectViolation ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.errors.EngineMessage violation , java.lang.String ... violatingEntities ) { java.util.List < java.lang.String > violations = helper.validate ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected violation {0} but only got {1}." , violation , violations ) , violations.contains ( violation.name ( ) ) ) ; for ( java.lang.String violationDetail : org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( ( violation + ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.LIST_SUFFIX ) ) , java.util.Arrays.asList ( violatingEntities ) ) ) { org.junit.Assert.assertThat ( "Missing violation entity" , violations , org.hamcrest.Matchers.hasItems ( violationDetail ) ) ; } }
Source:
protected void EndSuccessfully ( ) { EndActionOnAllImageGroups ( ) ; endVmRelatedOps ( ) ; setSucceeded ( true ) ; }

Target:
protected void EndImportCommand ( ) { setVm ( null ) ; EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; updateVmInSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }
Source:
public void getSpiceUsbAutoShare ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
protected boolean isDiskPassPciAndIdeLimit ( org.ovirt.engine.core.common.businessentities.Disk diskInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmInterfaces = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmNetworkInterfaceDAO ( ) . getAllForVm ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allVmDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; allVmDisks.add ( diskInfo ) ; return checkPciAndIdeLimit ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getnum_of_monitors ( ) , vmInterfaces , allVmDisks , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean isDiskPassPciAndIdeLimit ( org.ovirt.engine.core.common.businessentities.Disk diskInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmInterfaces = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmNetworkInterfaceDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allVmDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; allVmDisks.add ( diskInfo ) ; return checkPciAndIdeLimit ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getnum_of_monitors ( ) , vmInterfaces , allVmDisks , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( QueryType.GetRootTag , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAllTags , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , failure ) ; if ( failure == null ) { setUpEntityQueryExpectations ( QueryType.GetRootTag , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpRootTag ( ) ) ; } }
Source:
protected void setUpGetStorageServerConnectionExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { GUIDS [ 0 ] . toString ( ) } , org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.setUpStorageServerConnection ( 0 ) ) ; } }

Target:
protected void setUpGetStorageServerConnectionExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { GUIDS [ 0 ] . toString ( ) } , org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.setUpStorageServerConnection ( 0 ) ) ; } }
Source:
public boolean handle ( java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( directoryGroups.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { directoryGroups.add ( org.ovirt.engine.core.aaa.AuthzUtils.mapGroupRecord ( extension , queryResult ) ) ; } else { result = false ; } } return result ; }

Target:
public boolean handle ( java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( principalRecords.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { principalRecords.add ( queryResult ) ; } else { result = false ; break ; } } return result ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NetworkAttachment attachment ) { validateParameters ( attachment , "network.id|name" ) ; org.ovirt.engine.api.model.NetworkAttachment networkAttachment = map ( attachment ) ; org.ovirt.engine.core.common.action.NetworkAttachmentParameters params = new org.ovirt.engine.core.common.action.NetworkAttachmentParameters ( hostId , networkAttachment ) ; return performCreate ( ActionType.AddNetworkAttachment , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetNetworkAttachmentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NetworkAttachment attachment ) { validateParameters ( attachment , "network.id|name" ) ; org.ovirt.engine.api.model.NetworkAttachment networkAttachment = map ( attachment ) ; org.ovirt.engine.core.common.action.NetworkAttachmentParameters params = new org.ovirt.engine.core.common.action.NetworkAttachmentParameters ( hostId , networkAttachment ) ; return performCreate ( ActionType.AddNetworkAttachment , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetNetworkAttachmentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void testUpdateIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.CdRom update = getUpdate ( ) ; update.getFile ( ) . setId ( null ) ; control.replay ( ) ; try { resource.update ( update ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "CdRom" , "update" , "file.id" ) ; } }

Target:
public void testUpdateIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.CdRom update = new org.ovirt.engine.api.model.CdRom ( ) ; update.setFile ( null ) ; control.replay ( ) ; try { resource.update ( update ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "CdRom" , "update" , "file" ) ; } }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p , org.ovirt.engine.core.bll.ImportVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( VdcActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.ImportVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
public void testRemoveStorageDomainNull ( ) { setUpGetEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveStorageDomainNull ( ) { setUpGetEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants ) { userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; connectAutomatically.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setText ( constants.loginButtonLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants ) { headerLabel.setText ( constants.loginHeaderLabel ( ) ) ; userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; connectAutomatically.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setText ( constants.loginButtonLabel ( ) ) ; }
Source:
protected boolean isDomainInEditState ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isEditable = ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) && ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) ; return isEditable ; }

Target:
protected boolean isDomainInEditState ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isEditable = ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) && ( ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) || ( ( storageDomain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) ) ; return isEditable ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IpV6Address createIpV6Address ( java.sql.ResultSet rs , java.lang.String v6BootProtocol ) throws java.sql.SQLException { final org.ovirt.engine.core.common.businessentities.network.IpV6Address ipV6Address = new org.ovirt.engine.core.common.businessentities.network.IpV6Address ( ) ; ipV6Address.setBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.valueOf ( v6BootProtocol ) ) ; ipV6Address.setAddress ( rs.getString ( "ipv6_address" ) ) ; ipV6Address.setPrefix ( rs.getInt ( "ipv6_prefix" ) ) ; ipV6Address.setGateway ( rs.getString ( "ipv6_gateway" ) ) ; return ipV6Address ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IpV6Address createIpV6Address ( java.sql.ResultSet rs , java.lang.String v6BootProtocol ) throws java.sql.SQLException { final org.ovirt.engine.core.common.businessentities.network.IpV6Address ipV6Address = new org.ovirt.engine.core.common.businessentities.network.IpV6Address ( ) ; ipV6Address.setBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol.valueOf ( v6BootProtocol ) ) ; ipV6Address.setAddress ( rs.getString ( "ipv6_address" ) ) ; if ( ( rs.getObject ( "ipv6_prefix" ) ) != null ) { ipV6Address.setPrefix ( rs.getInt ( "ipv6_prefix" ) ) ; } ipV6Address.setGateway ( rs.getString ( "ipv6_gateway" ) ) ; return ipV6Address ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public void testUpdateUnregisteredDisksWithVMsWithEmptyUnregDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregDisks = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.utils.OvfUtils.updateUnregisteredDisksWithVMs ( unregDisks , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "TestVM" , xmlDocument ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , unregDisks.isEmpty ( ) ) ; }

Target:
public void testUpdateUnregisteredDisksWithVMsWithEmptyUnregDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregDisks = new java.util.ArrayList < > ( ) ; ovfUtils.updateUnregisteredDisksWithVMs ( unregDisks , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "TestVM" , xmlDocument ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , unregDisks.isEmpty ( ) ) ; }
Source:
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 ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . setAutoGeneratedSnapshotId ( vdcReturnValue.getActionReturnValue ( ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParentCommand ( ) , ( ( getCallback ( ) ) != null ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }