auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , final int sizeRequired , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; initializeVmDaoMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; }
Source:
public void testVmDuringSnaoshot ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT.name ( ) ) ) ; }

Target:
public void testVmDuringSnaoshot ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT.name ( ) ) ) ; }
Source:
public boolean isHostedEngine ( ) { boolean isExistingVmBehavior = ( getBehavior ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior ; if ( isExistingVmBehavior ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior ) ( getBehavior ( ) ) ) . getVm ( ) . isHostedEngine ( ) ; } return false ; }

Target:
public boolean isHostedEngine ( ) { boolean isExistingVmBehavior = ( getBehavior ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior ; if ( isExistingVmBehavior ) { org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior ) ( getBehavior ( ) ) ) ; return ( behavior.getVm ( ) ) != null ? behavior.getVm ( ) . isHostedEngine ( ) : false ; } return false ; }
Source:
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 ; }

Target:
public static boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }
Source:
public java.lang.Object runInTransaction ( ) { HandleVdsInformation ( ) ; vm.setRunOnVds ( getVdsId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { vm.setRunOnVds ( getVdsId ( ) ) ; if ( getParameters ( ) . isClearHibernationVolumes ( ) ) { vm.setHibernationVolHandle ( StringUtils.EMPTY ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; return null ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStoragePool , org.ovirt.engine.core.common.action.StoragePoolManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStoragePool , org.ovirt.engine.core.common.action.StoragePoolManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.StopProgress ( ) ; boolean isAllCanDoPassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllCanDoPassed = isAllCanDoPassed && ( returnValueBase.getCanDoAction ( ) ) ; if ( ! isAllCanDoPassed ) { break ; } } if ( isAllCanDoPassed ) { updateAlerts ( ) ; Cancel ( ) ; } }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel innerGeneralModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel ) ( model ) ) ; java.util.Map < java.lang.String , java.lang.String > serverMap = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( result ) ) ; if ( ! ( serverMap.isEmpty ( ) ) ) { innerGeneralModel.setHasNewGlusterHostsAlert ( true ) ; innerGeneralModel.setHasAnyAlert ( true ) ; } else { setHasNewGlusterHostsAlert ( false ) ; setHasAnyAlert ( false ) ; } }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportNetworkData importNetworkData = importModel.getNetworkImportData ( iface.getName ( ) ) ; java.util.List < java.lang.String > networkNames = importNetworkData.getNetworkNames ( ) ; ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkNames ) ; if ( networkNames.isEmpty ( ) ) { return "" ; } java.lang.String selectedNetworkName = importNetworkData.getSelectedNetworkName ( ) ; return selectedNetworkName != null ? selectedNetworkName : networkNames.get ( 0 ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : importModel.getNetworks ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }
Source:
protected org.ovirt.engine.api.model.VmPool deprecatedPopulate ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.core.common.businessentities.vm_pools entity ) { if ( ( model.isSetSize ( ) ) && ( ( model.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return model ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM getVM ( org.ovirt.engine.api.model.VmPool model ) { if ( isFiltered ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.GetVmdataByPoolIdParameters ( asGuid ( model.getId ( ) ) ) , model.getId ( ) ) ; } return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void diskImagesDontExist ( ) { org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_NOT_EXIST ) ) ; }

Target:
public void diskImagesDontExist ( ) { org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isDiskExists ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isDiskExists ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST ) ) ; }
Source:
public java.util.List < org.ovirt.engine.sdk.decorators.HostNIC > list ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; return list ( url , org.ovirt.engine.sdk.entities.HostNics.class , org.ovirt.engine.sdk.decorators.HostNIC.class ) ; }

Target:
public java.util.List < org.ovirt.engine.sdk.decorators.HostHostNic > list ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; return list ( url , org.ovirt.engine.sdk.entities.HostNics.class , org.ovirt.engine.sdk.decorators.HostHostNic.class ) ; }
Source:
public int totalVideoRAMSizeMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Map < java.lang.String , java.lang.Integer > settings = getVideoDeviceSettings ( vm.getStaticData ( ) ) ; return ( ( ( settings.getOrDefault ( VdsProperties.VIDEO_RAM , 0 ) ) + ( settings.getOrDefault ( VdsProperties.VIDEO_VRAM , 0 ) ) ) + 1023 ) / 1024 ; }

Target:
public static int totalVideoRAMSizeMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Map < java.lang.String , java.lang.Integer > settings = org.ovirt.engine.core.bll.utils.VideoDeviceSettings.getVideoDeviceSettings ( vm.getStaticData ( ) ) ; return ( ( ( settings.getOrDefault ( VdsProperties.VIDEO_RAM , 0 ) ) + ( settings.getOrDefault ( VdsProperties.VIDEO_VRAM , 0 ) ) ) + 1023 ) / 1024 ; }
Source:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { if ( ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.refreshHeavyWeight ( cluster.getcompatibility_version ( ) ) ) && ( cluster.supportsGlusterService ( ) ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getName ( ) , e ) ; } } } }

Target:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { if ( ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.refreshHeavyWeight ( cluster.getcompatibility_version ( ) ) ) && ( cluster.supportsGlusterService ( ) ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.error ( "Error while refreshing Gluster heavyweight data of cluster '{}': {}" , cluster.getName ( ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } } } }
Source:
public void stringPropertiesSyntax ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; org.junit.Assert.assertTrue ( "Invalid key/value delimiter" , utils.syntaxErrorInProperties ( "speed:1024;duplex=full" ) ) ; org.junit.Assert.assertTrue ( "Key/value delimiter present, but value missing" , utils.syntaxErrorInProperties ( "speed=1024;duplex=" ) ) ; org.junit.Assert.assertTrue ( "Missing value" , utils.syntaxErrorInProperties ( "speed=1024;duplex" ) ) ; org.junit.Assert.assertTrue ( "Invalid key character" , utils.syntaxErrorInProperties ( "spe*ed=1024;duplex=full" ) ) ; org.junit.Assert.assertTrue ( "Invalid value character" , utils.syntaxErrorInProperties ( "speed=1024;duplex=fu;ll" ) ) ; }

Target:
public void stringPropertiesSyntax ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; org.junit.Assert.assertTrue ( "Invalid key/value delimiter" , utils.syntaxErrorInProperties ( "speed:1024;duplex=full" ) ) ; org.junit.Assert.assertTrue ( "Missing key/value delimiter" , utils.syntaxErrorInProperties ( "speed=1024;duplex" ) ) ; org.junit.Assert.assertTrue ( "Invalid key character" , utils.syntaxErrorInProperties ( "spe*ed=1024;duplex=full" ) ) ; org.junit.Assert.assertTrue ( "Invalid value character" , utils.syntaxErrorInProperties ( "speed=1024;duplex=fu;ll" ) ) ; }
Source:
public void testKDCLocator ( ) { org.ovirt.engine.core.utils.kerberos.KDCLocator locator = new org.ovirt.engine.core.utils.kerberos.KDCLocator ( ) ; java.lang.String [ ] recordsList = new java.lang.String [ ] { "0 100 88 example.com." , "0 100 88 comp1.example.com" , "1 100 88 comp1.example.com." } ; org.ovirt.engine.core.utils.dns.DnsSRVLocator.DnsSRVResult result = locator.getKdc ( recordsList , "example.com" ) ; int numOfEntries = result.getNumOfValidAddresses ( ) ; junit.framework.Assert.assertEquals ( numOfEntries , 3 ) ; }

Target:
public void testKDCLocator ( ) { org.ovirt.engine.core.utils.kerberos.KDCLocator locator = new org.ovirt.engine.core.utils.kerberos.KDCLocator ( ) ; java.lang.String [ ] recordsList = new java.lang.String [ ] { "0 100 88 example.com." , "0 100 88 comp1.example.com" , "1 100 88 comp1.example.com." } ; org.ovirt.engine.core.utils.dns.DnsSRVLocator.DnsSRVResult result = locator.getKdc ( recordsList , "example.com" ) ; int numOfEntries = result.getNumOfValidAddresses ( ) ; org.junit.Assert.assertEquals ( numOfEntries , 3 ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ImageStatus map ( org.ovirt.engine.api.model.DiskStatus diskStatus ) { if ( diskStatus == null ) { return null ; } else { switch ( diskStatus ) { case ILLEGAL : return org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ; case LOCKED : return org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ; case OK : return org.ovirt.engine.core.common.businessentities.ImageStatus.OK ; default : return null ; } } }

Target:
public static java.lang.String map ( org.ovirt.engine.api.model.DiskStorageType diskStorageType ) { switch ( diskStorageType ) { case IMAGE : return DiskStorageType.IMAGE.value ( ) ; case CINDER : return DiskStorageType.CINDER.value ( ) ; case LUN : return DiskStorageType.LUN.value ( ) ; default : return null ; } }
Source:
protected java.lang.String getUrlBuilderCode ( java.util.List < org.ovirt.engine.sdk.entities.Parameter > parameters ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.sdk.entities.Parameter parameter : parameters ) { org.ovirt.engine.sdk.generator.java.templates.UrlBuilderParameterTemplate template = new org.ovirt.engine.sdk.generator.java.templates.UrlBuilderParameterTemplate ( ) ; buffer.append ( "\n" ) ; buffer.append ( template.evaluate ( parameter.getName ( ) , org.ovirt.engine.sdk.generator.java.utils.UrlUtils.toQueryParam ( parameter.getName ( ) ) , org.ovirt.engine.sdk.generator.java.utils.UrlUtils.toParamType ( parameter.getContext ( ) ) ) ) ; } return buffer.toString ( ) ; }

Target:
protected java.lang.String getUrlBuilderCode ( java.util.List < org.ovirt.engine.sdk.generator.java.ParameterData > parameters ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.sdk.generator.java.ParameterData parameter : parameters ) { if ( ( parameter.getType ( ) ) == ( org.ovirt.engine.sdk.generator.java.ParameterType.URL ) ) { org.ovirt.engine.sdk.generator.java.templates.UrlBuilderParameterTemplate template = new org.ovirt.engine.sdk.generator.java.templates.UrlBuilderParameterTemplate ( ) ; buffer.append ( "\n" ) ; buffer.append ( template.evaluate ( parameter ) ) ; } } return buffer.toString ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForClonedDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > disksMap = getDomainsDisksMap ( disksList ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForClonedDisks ( disksList ) ; } } ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForClonedDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > disksMap = getDomainsDisksMap ( diskImages ) ; return validOrFirstFailure ( new org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator.ValidatorPredicate ( ) { @ java.lang.Override public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForClonedDisks ( disksList ) ; } } ) ; }
Source:
public void setUsePatternFly ( boolean usePatternFly ) { if ( usePatternFly ) { container.addStyleName ( Styles.FORM_CONTROL ) ; container.addStyleName ( style.container ( ) ) ; getWidget ( ) . addStyleName ( style.listBox ( ) ) ; groupLabelContainer.addStyleName ( style.labelContainer ( ) ) ; } }

Target:
public void setUsePatternFly ( boolean usePatternFly ) { getWidget ( ) . addStyleName ( style.listBox ( ) ) ; if ( usePatternFly ) { container.addStyleName ( Styles.FORM_CONTROL ) ; container.addStyleName ( style.container ( ) ) ; getWidget ( ) . addStyleName ( style.listBoxPatternfly ( ) ) ; groupLabelContainer.addStyleName ( style.labelContainer ( ) ) ; } else { container.addStyleName ( style.container_legacy ( ) ) ; } }
Source:
public static int [ ] asIntArray ( java.util.List < ? > l ) { int [ ] ret = new int [ l.size ( ) ] ; int i = 0 ; for ( java.lang.Object o : l ) { ret [ ( i ++ ) ] = java.lang.Integer.valueOf ( o.toString ( ) ) ; } return ret ; }

Target:
public static int [ ] asIntArray ( java.util.List < ? > l , int def , int size ) { int [ ] ret = new int [ size ] ; java.util.Arrays.fill ( ret , def ) ; for ( int i = 0 ; ( i < ( l.size ( ) ) ) && ( i < size ) ; i ++ ) { ret [ i ] = java.lang.Integer.valueOf ( l.get ( i ) . toString ( ) ) ; } return ret ; }
Source:
public void testProcessingSoftwareGluster ( ) { org.mockito.Mockito.doThrow ( new java.lang.RuntimeException ( ) ) . when ( glusterStrategy ) . processSoftwareCapabilities ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; exception.expect ( java.lang.RuntimeException.class ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; strategy.processSoftwareCapabilities ( vds ) ; }

Target:
public void testProcessingSoftwareGluster ( ) { org.mockito.Mockito.doThrow ( new java.lang.RuntimeException ( ) ) . when ( glusterStrategy ) . processSoftwareCapabilities ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; exception.expect ( java.lang.RuntimeException.class ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; strategy.processSoftwareCapabilities ( vds ) ; }
Source:
public void testGetAllStoragePoolSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( "Datacenter:" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( storagePoolResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllMultiStoragePoolSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Datacenters" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( storagePoolResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmTemplate getVmTemplateEntity ( int index ) { org.ovirt.engine.core.common.businessentities.VmTemplate vm = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VmTemplate.class ) , index ) ; org.easymock.EasyMock.expect ( vm.getDiskTemplateMap ( ) ) . andReturn ( getDiskMap ( ) ) . anyTimes ( ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplate getVmTemplateEntity ( int index ) { org.ovirt.engine.core.common.businessentities.VmTemplate vm = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.setUpEntityExpectations ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VmTemplate.class ) , index ) ; org.mockito.Mockito.when ( vm.getDiskTemplateMap ( ) ) . thenReturn ( getDiskMap ( ) ) ; return vm ; }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = getBackendCollection ( VdcQueryType.GetNetworksByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ; org.ovirt.engine.api.model.Networks networks = mapCollection ( entities ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
protected org.ovirt.engine.core.common.queries.VdcQueryParametersBase getQueryParameters ( ) { return new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ; }
Source:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.storage_server_connections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static 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 ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; if ( org.ovirt.engine.core.utils.FileUtil.fileExists ( org.ovirt.engine.core.common.config.Config.resolveCACertificatePath ( ) ) ) { org.ovirt.engine.core.compat.backendcompat.StreamReaderCompat reader = new org.ovirt.engine.core.compat.backendcompat.StreamReaderCompat ( org.ovirt.engine.core.common.config.Config.resolveCACertificatePath ( ) ) ; try { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( reader.ReadToEnd ( ) ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } finally { reader.dispose ( ) ; } } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; java.lang.String path = org.ovirt.engine.core.common.config.Config.resolveCACertificatePath ( ) ; if ( org.ovirt.engine.core.utils.FileUtil.fileExists ( path ) ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.utils.FileUtil.readAllText ( path ) ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.bookmarks o1 , org.ovirt.engine.core.common.businessentities.bookmarks o2 ) { java.lang.String name1 = o1.getbookmark_name ( ) ; java.lang.String name2 = o2.getbookmark_name ( ) ; if ( ( name1 == null ) || ( name2 == null ) ) { throw new java.lang.IllegalArgumentException ( "Bookmark name cannot be null" ) ; } return name1.compareTo ( name2 ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.Bookmark o1 , org.ovirt.engine.core.common.businessentities.Bookmark o2 ) { java.lang.String name1 = o1.getbookmark_name ( ) ; java.lang.String name2 = o2.getbookmark_name ( ) ; if ( ( name1 == null ) || ( name2 == null ) ) { throw new java.lang.IllegalArgumentException ( "Bookmark name cannot be null" ) ; } return name1.compareTo ( name2 ) ; }
Source:
private java.lang.String readEventLogValue ( org.ovirt.engine.core.compat.backendcompat.XmlNode content , java.lang.String name ) { java.lang.StringBuilder fullNameSB = new java.lang.StringBuilder ( org.ovirt.engine.core.utils.ovf.OvfVmReader.EXPORT_ONLY_PREFIX ) ; fullNameSB.append ( name ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = content.SelectSingleNode ( fullNameSB.toString ( ) ) ; if ( node != null ) { return node.innerText ; } return null ; }

Target:
private java.lang.String readEventLogValue ( org.ovirt.engine.core.utils.ovf.xml.XmlNode content , java.lang.String name ) { java.lang.StringBuilder fullNameSB = new java.lang.StringBuilder ( org.ovirt.engine.core.utils.ovf.OvfVmReader.EXPORT_ONLY_PREFIX ) ; fullNameSB.append ( name ) ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node = content.SelectSingleNode ( fullNameSB.toString ( ) ) ; if ( node != null ) { return node.innerText ; } return null ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic before = dao.get ( existingVm.getId ( ) ) ; before.setvm_host ( "farkle.redhat.com" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VmDynamic after = dao.get ( existingVm.getId ( ) ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic before = dao.get ( existingVm.getId ( ) ) ; before.setVmHost ( "farkle.redhat.com" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VmDynamic after = dao.get ( existingVm.getId ( ) ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
protected org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand < 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.AddVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param , org.ovirt.engine.core.bll.context.CommandContext.createContext ( param.getSessionId ( ) ) ) { @ java.lang.Override protected void initUser ( ) { } @ java.lang.Override protected void initTemplate ( ) { } } ) ; return command ; }

Target:
protected org.ovirt.engine.core.bll.AddVmPoolCommand < 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.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param , org.ovirt.engine.core.bll.context.CommandContext.createContext ( param.getSessionId ( ) ) ) { @ java.lang.Override protected void initUser ( ) { } @ java.lang.Override protected void initTemplate ( ) { } } ) ; return command ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.context.CommandContext createContextForStatelessSnapshotCreation ( ) { java.util.Map < java.lang.String , java.lang.String > values = getVmValuesForMsgResolving ( ) ; org.ovirt.engine.core.common.job.Step createSnapshotsStep = addSubStep ( StepEnum.EXECUTING , StepEnum.CREATING_SNAPSHOTS , values ) ; org.ovirt.engine.core.bll.job.ExecutionContext createSnapshotsCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; createSnapshotsCtx.setMonitored ( true ) ; createSnapshotsCtx.setStep ( createSnapshotsStep ) ; return org.ovirt.engine.core.bll.RunVmCommand.cloneContext ( ) . withExecutionContext ( createSnapshotsCtx ) ; }

Target:
private org.ovirt.engine.core.bll.context.CommandContext createContextForStatelessSnapshotCreation ( ) { java.util.Map < java.lang.String , java.lang.String > values = getVmValuesForMsgResolving ( ) ; org.ovirt.engine.core.common.job.Step createSnapshotsStep = addSubStep ( StepEnum.EXECUTING , StepEnum.CREATING_SNAPSHOTS , values ) ; org.ovirt.engine.core.bll.job.ExecutionContext createSnapshotsCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; createSnapshotsCtx.setMonitored ( true ) ; createSnapshotsCtx.setStep ( createSnapshotsStep ) ; return org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) . withExecutionContext ( createSnapshotsCtx ) ; }
Source:
private void logException ( java.lang.RuntimeException ex ) { log.error ( "Command '{}' execution failed: {}" , this , ex.getMessage ( ) ) ; log.debug ( "Exception" , ex ) ; }

Target:
private void logException ( java.lang.RuntimeException ex ) { if ( ! ( ex.getMessage ( ) . contains ( "Policy reset" ) ) ) { log.error ( "Command '{}' execution failed: {}" , this , ex.getMessage ( ) ) ; log.debug ( "Exception" , ex ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.FileTypeExtension fileTypeExtension , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , fileTypeExtension , forceRefresh ) ) ) { return null ; } repoList = getCachedIsoListByDomainId ( storageDomainId , fileTypeExtension ) ; return repoList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageType imageType , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { return null ; } repoList = getCachedIsoListByDomainId ( storageDomainId , imageType ) ; return repoList ; }
Source:
private void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.RemoveQosModel.getCommands ( ) . add ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "onRemove" , this ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) . setIsDefault ( true ) ) ; org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.RemoveQosModel.getCommands ( ) . add ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "cancel" , this ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) . setIsCancel ( true ) ) ; }

Target:
private void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.RemoveQosModel.getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "onRemove" , this ) ) ; org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.RemoveQosModel.getCommands ( ) . add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "cancel" , this ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Permit model , int index ) { assertEquals ( java.lang.Integer.toString ( ( index + 1 ) ) , model.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( ( index + 1 ) ) ; assertEquals ( actionGroup.name ( ) . toLowerCase ( ) , model.getName ( ) ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Permit model , int index ) { org.junit.Assert.assertEquals ( java.lang.Integer.toString ( ( index + 1 ) ) , model.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( ( index + 1 ) ) ; org.junit.Assert.assertEquals ( actionGroup.name ( ) . toLowerCase ( ) , model.getName ( ) ) ; }
Source:
public static void GetTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }

Target:
public static void GetClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }
Source:
public static boolean CanRemoveAdGroup ( org.ovirt.engine.core.compat.Guid groupId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.isLastSuperUserGroup ( groupId ) ) { returnValue = false ; reasons.add ( VdcBllMessages.ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE.toString ( ) ) ; } if ( groupId.equals ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID ) ) { returnValue = false ; reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_BUILTIN_GROUP_EVERYONE.name ( ) ) ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.compat.Guid groupId = org.ovirt.engine.core.bll.RemoveAdGroupCommand.getParameters ( ) . getAdElementId ( ) ; java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.RemoveAdGroupCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; boolean returnValue = true ; if ( isLastSuperUserGroup ( groupId ) ) { returnValue = false ; reasons.add ( VdcBllMessages.ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE.toString ( ) ) ; } if ( groupId.equals ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID ) ) { returnValue = false ; reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_BUILTIN_GROUP_EVERYONE.name ( ) ) ; } return returnValue ; }
Source:
protected void postSaveAction ( org.ovirt.engine.core.compat.Guid networkGuid , boolean succeeded ) { if ( succeeded ) { cancel ( ) ; } StopProgress ( ) ; }

Target:
private void onSave ( ) { if ( ! ( validate ( ) ) ) { return ; } org.ovirt.engine.core.common.businessentities.Provider provider = new org.ovirt.engine.core.common.businessentities.Provider ( ) ; provider.setName ( ( ( java.lang.String ) ( privateName.getEntity ( ) ) ) ) ; provider.setDescription ( ( ( java.lang.String ) ( privateDescription.getEntity ( ) ) ) ) ; provider.setUrl ( ( ( java.lang.String ) ( privateUrl.getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.AddProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) ) ; cancel ( ) ; }