auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getStorageDomainById ( 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void testIncludeExcludeOrder ( ) { java.lang.String expected = "alonbl@redhat.com" ; filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( ( ( ( ( ( ( ( ( ( ( ( ( "" + "include:message1(smtp:" ) + expected ) + ") " ) + "include:message2(smtp:" ) + expected ) + ") " ) + "exclude:message3(smtp:" ) + expected ) + ") " ) + "exclude:message1(smtp:" ) + expected ) + ") " ) + "include:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message2" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message3" ) ) ; org.ovirt.engine.core.notifier.filter.AuditLogEvent event = smtp.getEvents ( ) . get ( 0 ) ; java.lang.String name = smtp.getNames ( ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "message1" , event.getName ( ) ) ; org.junit.Assert.assertEquals ( expected , name ) ; event = smtp.getEvents ( ) . get ( 1 ) ; name = smtp.getNames ( ) . get ( 1 ) ; org.junit.Assert.assertEquals ( "message2" , event.getName ( ) ) ; org.junit.Assert.assertEquals ( expected , name ) ; org.junit.Assert.assertEquals ( 2 , smtp.getEvents ( ) . size ( ) ) ; }

Target:
public void testAll ( ) throws java.lang.Exception { filter.clearFilterEntries ( ) ; filter.addFilterEntries ( java.util.Collections.singletonList ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.FilterEntry ( "kuku" , false , "snmp" , "pupu" ) ) ) ; filter.addFilterEntries ( java.util.Collections.singletonList ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.FilterEntry ( "kuku" , false , "smtp" , "pupu" ) ) ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( "" + "include:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; org.junit.Assert.assertTrue ( snmp.getEvents ( ) . contains ( "message1-->pupu" ) ) ; org.junit.Assert.assertTrue ( smtp.getEvents ( ) . contains ( "message1-->pupu" ) ) ; }
Source:
protected void initResource ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource < R , Q > resource ) { resource.setBackend ( backend ) ; resource.setMappingLocator ( mapperLocator ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMessageBundle ( messageBundle ) ; resource.setHttpHeaders ( httpHeaders ) ; }

Target:
protected void initResource ( org.ovirt.engine.api.restapi.resource.AbstractBackendResource < R , Q > resource ) { resource.setBackend ( backend ) ; resource.setMappingLocator ( mapperLocator ) ; resource.setValidatorLocator ( validatorLocator ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMessageBundle ( messageBundle ) ; resource.setHttpHeaders ( httpHeaders ) ; }
Source:
public void testUpdateStatus ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate before = dao.get ( existingTemplate.getId ( ) ) ; before.setstatus ( VmTemplateStatus.Locked ) ; dao.updateStatus ( existingTemplate.getId ( ) , VmTemplateStatus.Locked ) ; org.ovirt.engine.core.common.businessentities.VmTemplate after = dao.get ( existingTemplate.getId ( ) ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdateStatus ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate before = dao.get ( existingTemplate.getId ( ) ) ; before.setStatus ( VmTemplateStatus.Locked ) ; dao.updateStatus ( existingTemplate.getId ( ) , VmTemplateStatus.Locked ) ; org.ovirt.engine.core.common.businessentities.VmTemplate after = dao.get ( existingTemplate.getId ( ) ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
private void testFillRemoteViewerUrl ( java.lang.String toRepalce , java.lang.String baseUrl , java.lang.String resourceUrl , java.lang.String expected ) { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( ) ; org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams params = new org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams ( getValidOptions ( GraphicsType.SPICE ) , false ) ; org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery query = new org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery ( params ) ; query.fillRemoteViewerUrl ( options , toRepalce , baseUrl , resourceUrl ) ; org.junit.Assert.assertEquals ( expected , options.getRemoteViewerNewerVersionUrl ( ) ) ; }

Target:
private void testFillRemoteViewerUrl ( java.lang.String toRepalce , java.lang.String baseUrl , java.lang.String resourceUrl , java.lang.String expected ) { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; getQuery ( ) . fillRemoteViewerUrl ( options , toRepalce , baseUrl , resourceUrl ) ; org.junit.Assert.assertEquals ( expected , options.getRemoteViewerNewerVersionUrl ( ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true , true ) ; setUpClusterExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true , true ) ; setUpClusterExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) ) ; }
Source:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVdsCommand.getVdsIdRef ( ) ) != null ) && ( CanBeRemoved ( org.ovirt.engine.core.bll.RemoveVdsCommand.getVdsId ( ) ) ) ) { glusterHostRemove ( ) ; RemoveVdsStatisticsFromDb ( ) ; RemoveVdsDynamicFromDb ( ) ; RemoveVdsStaticFromDb ( ) ; RemoveVdsFromCollection ( ) ; org.ovirt.engine.core.bll.RemoveVdsCommand.setSucceeded ( true ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { RemoveVdsStatisticsFromDb ( ) ; RemoveVdsDynamicFromDb ( ) ; RemoveVdsStaticFromDb ( ) ; return null ; }
Source:
protected void executeQueryCommand ( ) { if ( ( org.ovirt.engine.core.bll.GetVmsInitQuery.getParameters ( ) . getIds ( ) ) != null ) { org.ovirt.engine.core.bll.GetVmsInitQuery.getQueryReturnValue ( ) . setReturnValue ( vmHandler.getVmInitByIds ( org.ovirt.engine.core.bll.GetVmsInitQuery.getParameters ( ) . getIds ( ) , true ) ) ; } }

Target:
protected void executeQueryCommand ( ) { if ( ( org.ovirt.engine.core.bll.GetVmsInitQuery.getParameters ( ) . getIds ( ) ) != null ) { org.ovirt.engine.core.bll.GetVmsInitQuery.getQueryReturnValue ( ) . setReturnValue ( vmHandler.getVmInitWithoutPasswordByIds ( org.ovirt.engine.core.bll.GetVmsInitQuery.getParameters ( ) . getIds ( ) ) ) ; } }
Source:
public void testConnectionWithInvalidMountOptionsFails ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) . when ( getCommand ( ) ) . validateMountOptions ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( getCommand ( ) , EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ; }

Target:
public void testConnectionWithInvalidMountOptionsFails ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.ovirt.engine.core.bll.storage.connection.StorageServerConnectionTestCommon.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) . when ( command ) . validateMountOptions ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ; }
Source:
public void testParseInvalidOption ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three" , "one=bool,two=int,three=bool" ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" ) ; }

Target:
public void testParseInvalidOption ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three" , "one=bool,two=int,three=bool" ) ; org.junit.Assert.assertNotNull ( ret ) ; org.junit.Assert.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" ) ; }
Source:
public void addFilterEntries ( java.util.List < org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.FilterEntry > entries ) { for ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.FilterEntry entry : entries ) { org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.log.debug ( java.lang.String.format ( "addFilterEntry: %s" , entry ) ) ; notify.add ( entry ) ; if ( ( entry.getRecipient ( ) ) != null ) { addRecipient ( entry.getRecipient ( ) ) ; } } }

Target:
public void addFilterEntries ( java.util.List < org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.FilterEntry > entries ) { for ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.FilterEntry entry : entries ) { org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.log.debug ( "addFilterEntry: {}" , entry ) ; notify.add ( entry ) ; if ( ( entry.getRecipient ( ) ) != null ) { addRecipient ( entry.getRecipient ( ) ) ; } } }
Source:
public boolean isPowerManagementEnabledAndLegal ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup , java.util.List < java.lang.String > messages ) { if ( ! ( ( vds.isPmEnabled ( ) ) && ( isPowerManagementLegal ( vds.getFenceAgents ( ) , vdsGroup , messages ) ) ) ) { messages.add ( EngineMessage.VDS_FENCE_DISABLED.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isPowerManagementEnabledAndLegal ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < java.lang.String > messages ) { if ( ! ( ( vds.isPmEnabled ( ) ) && ( isPowerManagementLegal ( vds.getFenceAgents ( ) , cluster , messages ) ) ) ) { messages.add ( EngineMessage.VDS_FENCE_DISABLED.name ( ) ) ; return false ; } else { return true ; } }
Source:
protected void verifyLinks ( org.ovirt.engine.api.model.BaseResource model ) { assertNotNull ( model.getHref ( ) ) ; assertTrue ( model.getHref ( ) . startsWith ( "/api" ) ) ; for ( org.ovirt.engine.api.model.Link link : model.getLinks ( ) ) { assertTrue ( link.getHref ( ) . startsWith ( "/api" ) ) ; } }

Target:
protected void verifyLinks ( org.ovirt.engine.api.model.BaseResource model ) { assertNotNull ( model.getHref ( ) ) ; assertTrue ( model.getHref ( ) . startsWith ( "/ovirt-engine/api" ) ) ; for ( org.ovirt.engine.api.model.Link link : model.getLinks ( ) ) { assertTrue ( link.getHref ( ) . startsWith ( "/ovirt-engine/api" ) ) ; } }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , getEntityList ( ) ) ; } }

Target:
private static org.ovirt.engine.api.model.Network getModel ( int index ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; return model ; }
Source:
protected boolean checkNumberOfMonitors ( ) { return org.ovirt.engine.core.bll.VmHandler.isNumOfMonitorsLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfMonitors ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkNumberOfMonitors ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes = org.ovirt.engine.core.bll.VmHandler.getResultingVmGraphics ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.getGraphicsTypesOfEntity ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplateId ( ) ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) ) ; int numOfMonitors = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfMonitors ( ) ; return org.ovirt.engine.core.bll.VmHandler.isNumOfMonitorsLegal ( graphicsTypes , numOfMonitors , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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 ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
protected void addBootProtocolForRoleNetwork ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { if ( ( ( ( networkCluster.isDisplay ( ) ) || ( networkCluster.isMigration ( ) ) ) || ( networkCluster.isGluster ( ) ) ) && ( ( ( nic.getBootProtocol ( ) ) == null ) || ( ( nic.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ) { nic.setBootProtocol ( NetworkBootProtocol.DHCP ) ; } }

Target:
protected void addBootProtocolForRoleNetwork ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { if ( ( org.ovirt.engine.core.utils.NetworkUtils.isRoleNetwork ( networkCluster ) ) && ( ( ( nic.getBootProtocol ( ) ) == null ) || ( ( nic.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ) { nic.setBootProtocol ( NetworkBootProtocol.DHCP ) ; } }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , params , aQuery ) ; }

Target:
public static void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
private java.lang.String getInstalledVdsIdIfExists ( org.ovirt.engine.core.utils.ssh.SSHClient client ) { try { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 256 ) ; client.executeCommand ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.GetVdsmIdByVdsmToolCommand ) , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } catch ( java.lang.Exception e ) { log.warnFormat ( "Failed to initiate vdsm-id request on host" , e ) ; return null ; } }

Target:
private java.lang.String getInstalledVdsIdIfExists ( org.ovirt.engine.core.bll.utils.EngineSSHClient client ) { try { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 256 ) ; client.executeCommand ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.GetVdsmIdByVdsmToolCommand ) , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } catch ( java.lang.Exception e ) { log.warnFormat ( "Failed to initiate vdsm-id request on host" , e ) ; return null ; } }
Source:
protected void saveDiskImageDynamic ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.DiskImageDynamic ( ) ; diskDynamic.setId ( disk.getImageId ( ) ) ; diskDynamic.setactual_size ( disk.getActualSizeInBytes ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getDiskImageDynamicDAO ( ) . save ( diskDynamic ) ; }

Target:
protected void saveDiskImageDynamic ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( disk.getImageId ( ) ) ; diskDynamic.setactual_size ( disk.getActualSizeInBytes ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getDiskImageDynamicDAO ( ) . save ( diskDynamic ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; } } return diskImage ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImage ( ) { if ( ( diskImage ) == null ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = diskDao.get ( org.ovirt.engine.core.bll.storage.repoimage.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) ) { diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; } } return diskImage ; }
Source:
private boolean attachmentForNetworkAlreadyExist ( java.lang.String networkName , java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > existingNetworkAttachments ) { org.ovirt.engine.core.common.businessentities.network.Network network = clusterNetworks.get ( networkName ) ; return containsNetwork ( existingNetworkAttachments , network ) ; }

Target:
private void createNetworkAttachmentForReportedNetworksNotHavingOne ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; networkAttachment.setNetworkId ( clusterNetworks.get ( networkName ) . getId ( ) ) ; org.ovirt.engine.core.compat.Guid nicId = getBaseInterfaceNicOrThis ( nic ) . getId ( ) ; networkAttachment.setNicId ( nicId ) ; networkAttachment.setProperties ( nic.getCustomProperties ( ) ) ; networkAttachment.setIpConfiguration ( createIpConfigurationFromVdsNetworkInterface ( nic ) ) ; networkAttachmentDao.save ( networkAttachment ) ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.VdsGroupOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpManagementNetworkExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; final org.ovirt.engine.api.model.Cluster updatedCluster = resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; verifyModel ( updatedCluster , 0 ) ; verifyManagementNetwork ( updatedCluster ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( target ) ) ; loginModel.setENGINEUserActionGroupList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( returnValue ) ) ) ; loginModel.getENGINEUserActionGroupList ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel.ConsumeQuotaActionGroup ) ; loginModel.getUserRoles ( loginModel ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > returnValue ) { setEngineUserActionGroupList ( returnValue ) ; getEngineUserActionGroupList ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel.ConsumeQuotaActionGroup ) ; getUserRoles ( ) ; }
Source:
public void externalVMWhenMissingInDb ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , false ) ; mockVmStatic ( false ) ; mockVmNotInDb ( data ) ; org.junit.Assume.assumeTrue ( ( ( data.dbVm ( ) ) == null ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) != null ) ) ; vmAnalyzer.analyze ( ) ; junit.framework.Assert.assertTrue ( vmAnalyzer.isExternalVm ( ) ) ; }

Target:
public void externalVMWhenMissingInDb ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , false ) ; mockVmStatic ( false ) ; mockVmNotInDb ( data ) ; org.junit.Assume.assumeTrue ( ( ( data.dbVm ( ) ) == null ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) != null ) ) ; vmAnalyzer.analyze ( ) ; org.junit.Assert.assertTrue ( vmAnalyzer.isExternalVm ( ) ) ; }
Source:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = diskImageDao.getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }

Target:
public static void isMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.QuotaStorage getSpecificQuotaStorage ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage = new org.ovirt.engine.core.common.businessentities.QuotaStorage ( ) ; quotaStorage.setQuotaId ( quotaId ) ; quotaStorage.setQuotaStorageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; quotaStorage.setStorageId ( FixturesTool.STORAGE_DOAMIN_NFS_MASTER ) ; quotaStorage.setStorageSizeGB ( 10000L ) ; quotaStorage.setStorageSizeGBUsage ( 0.0 ) ; return quotaStorage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.QuotaStorage getSpecificQuotaStorage ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage = new org.ovirt.engine.core.common.businessentities.QuotaStorage ( ) ; quotaStorage.setQuotaId ( quotaId ) ; quotaStorage.setQuotaStorageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; quotaStorage.setStorageId ( FixturesTool.STORAGE_DOMAIN_NFS_MASTER ) ; quotaStorage.setStorageSizeGB ( 10000L ) ; quotaStorage.setStorageSizeGBUsage ( 0.0 ) ; return quotaStorage ; }
Source:
public int hashCode ( ) { return java.util.Objects.hash ( super . hashCode ( ) , ipv4Address , ipv6Address , bondName , bondOptions , bondType , bonded , ipv4BootProtocol , ipv6BootProtocol , reportedSwitchType , networkName , bridged , ipv4Gateway , ipv6Gateway , mtu , ipv4Subnet , ipv6Prefix , vdsId , baseInterface , vlanId , qos , labels , adPartnerMac , adAggregatorId ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( super . hashCode ( ) , ipv4Address , ipv6Address , bondName , bondOptions , bondType , bonded , ipv4BootProtocol , ipv6BootProtocol , reportedSwitchType , networkName , bridged , ipv4Gateway , ipv4DefaultRoute , ipv6Gateway , mtu , ipv4Subnet , ipv6Prefix , vdsId , baseInterface , vlanId , qos , labels , adPartnerMac , adAggregatorId ) ; }
Source:
private static java.lang.String getDeviceTypeSearchExpr ( java.lang.String type , java.lang.String device ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( "type=" ) ; sb.append ( type ) ; sb.append ( " device=" ) ; sb.append ( device ) ; sb.append ( " " ) ; return sb.toString ( ) ; }

Target:
private static java.lang.String getDeviceTypeSearchExpr ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , java.lang.String device ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( "type=" ) ; sb.append ( type.getValue ( ) ) ; sb.append ( " device=" ) ; sb.append ( device ) ; sb.append ( " " ) ; return sb.toString ( ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VmPool update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VmPool.class , org.ovirt.engine.sdk.decorators.VmPool.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VmPool update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( correlationId != null ) { headersBuilder.add ( "Correlation-Id" , correlationId ) ; } java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.VmPool.class , org.ovirt.engine.sdk.decorators.VmPool.class , headers ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageView.Driver.driver.edit ( object ) ; initLists ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { driver.edit ( object ) ; initLists ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } } } ) ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > balance ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.ArrayList < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getName ( ) ) ) + "balance is not implemented" ) ) ; return null ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > balance ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.ArrayList < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getPolicyUnit ( ) . getName ( ) ) ) + "balance is not implemented" ) ) ; return null ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getDistributedVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getVolume ( volumeId ) ; volume.setStatus ( ( volumeId == ( volumeId1 ) ? org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.UP : org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.DOWN ) ) ; volume.setBricks ( getBricks ( volumeId , "distrib" , 2 ) ) ; volume.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; volume.setClusterId ( clusterId ) ; return volume ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getDistributedVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getVolume ( volumeId ) ; volume.setStatus ( ( volumeId == ( volumeId1 ) ? org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP : org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.DOWN ) ) ; volume.setBricks ( getBricks ( volumeId , "distrib" , 2 ) ) ; volume.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; volume.setClusterId ( clusterId ) ; return volume ; }
Source:
public static org.ovirt.engine.core.vdsbroker.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.vdsbroker.MonitoringStrategy returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.virtMonitoringStrategy ; org.ovirt.engine.core.compat.Guid vdsGroupId = vds.getvds_group_id ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.vdsGroupDao.get ( vdsGroupId ) ; if ( ( vdsGroup.supportsVirtService ( ) ) && ( vdsGroup.supportsGlusterService ( ) ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.multipleMonitoringStrategy ; } else if ( vdsGroup.supportsVirtService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.virtMonitoringStrategy ; } else if ( vdsGroup.supportsGlusterService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.glusterMonitoringStrategy ; } return returnedStrategy ; }

Target:
public static org.ovirt.engine.core.vdsbroker.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.vdsbroker.MonitoringStrategy returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.virtMonitoringStrategy ; org.ovirt.engine.core.compat.Guid vdsGroupId = vds.getVdsGroupId ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.vdsGroupDao.get ( vdsGroupId ) ; if ( ( vdsGroup.supportsVirtService ( ) ) && ( vdsGroup.supportsGlusterService ( ) ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.multipleMonitoringStrategy ; } else if ( vdsGroup.supportsVirtService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.virtMonitoringStrategy ; } else if ( vdsGroup.supportsGlusterService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.glusterMonitoringStrategy ; } return returnedStrategy ; }
Source:
private boolean evaluateNewVisibility ( com.google.gwt.user.client.ui.Widget source , boolean desiredVisibility ) { if ( ! ( widgetConfiguration.containsKey ( source ) ) ) { return desiredVisibility ; } org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig vmPopupWidgetConfig = widgetConfiguration.get ( source ) ; if ( vmPopupWidgetConfig.isAlwaysHidden ( ) ) { return false ; } vmPopupWidgetConfig.setApplicationLevelVisible ( desiredVisibility ) ; boolean advancedMode = ( ( java.lang.Boolean ) ( model.getAdvancedMode ( ) . getEntity ( ) ) ) ; return vmPopupWidgetConfig.isCurrentlyVisible ( advancedMode ) ; }

Target:
private boolean evaluateNewVisibility ( com.google.gwt.user.client.ui.Widget source , boolean desiredVisibility ) { if ( ! ( widgetConfiguration.containsKey ( source ) ) ) { return desiredVisibility ; } org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig vmPopupWidgetConfig = widgetConfiguration.get ( source ) ; if ( vmPopupWidgetConfig.isAlwaysHidden ( ) ) { return false ; } vmPopupWidgetConfig.setApplicationLevelVisible ( desiredVisibility ) ; boolean advancedMode = model.getAdvancedMode ( ) . getEntity ( ) ; return vmPopupWidgetConfig.isCurrentlyVisible ( advancedMode , createInstanceMode ) ; }
Source:
private static java.lang.String chopEnd ( java.lang.String str , java.lang.String chop ) { if ( str.endsWith ( chop ) ) { return str.substring ( 0 , ( ( str.length ( ) ) - ( chop.length ( ) ) ) ) ; } else { return str ; } }

Target:
private static java.lang.String getPath ( java.lang.Class < ? > clz ) { for ( java.lang.reflect.Method method : org.ovirt.engine.api.resource.SystemResource.class . getMethods ( ) ) { if ( ( method.getReturnType ( ) ) == clz ) { javax.ws.rs.Path annotation = method.getAnnotation ( javax.ws.rs.Path.class ) ; if ( annotation != null ) { return annotation.value ( ) ; } } } org.ovirt.engine.api.utils.LinkHelper.log.error ( ( ( "Can\'t find relative path for class \"" + ( clz.getName ( ) ) ) + "\", will return null" ) ) ; return null ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isVmPluggedDiskNotUsingScsiReservation ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = getDbFacade ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( device.getIsPlugged ( ) ) && ( device.isUsingScsiReservation ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION , java.lang.String.format ( "$VmName %s" , vm.getName ( ) ) ) ; } } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isVmPluggedDiskNotUsingScsiReservation ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = getDbFacade ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( device.getIsPlugged ( ) ) && ( device.isUsingScsiReservation ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION , java.lang.String.format ( "$VmName %s" , vm.getName ( ) ) ) ; } } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.bookmarks bookmark ) { org.ovirt.engine.core.compat.Guid id = bookmark.getbookmark_id ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; bookmark.setbookmark_id ( id ) ; } org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = new org.ovirt.engine.core.dao.BookmarkDAODbFacadeImpl.BookmarkSqlParameterSource ( bookmark ) ; getCallsHandler ( ) . executeModification ( "InsertBookmark" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.Bookmark bookmark ) { org.ovirt.engine.core.compat.Guid id = bookmark.getbookmark_id ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; bookmark.setbookmark_id ( id ) ; } org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = new org.ovirt.engine.core.dao.BookmarkDAODbFacadeImpl.BookmarkSqlParameterSource ( bookmark ) ; getCallsHandler ( ) . executeModification ( "InsertBookmark" , parameterSource ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepSessionList ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc ( vdsServer.glusterVolumeGeoRepConfigList ( volumeName , slaveHost , slaveVolumeName , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }