auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void canDoActionImageNotFound ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( diskImageDao.getSnapshotById ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionImageNotFound ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( diskImageDao.getSnapshotById ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }
Source:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "address" , getAddress ( ) ) . append ( "netmask" , getNetmask ( ) ) . append ( "gateway" , getGateway ( ) ) . build ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "address" , getAddress ( ) ) . append ( "netmask" , getNetmask ( ) ) . append ( "gateway" , getGateway ( ) ) . append ( "bootProtocol" , getBootProtocol ( ) ) . build ( ) ; }
Source:
protected void expectGetIsAttached ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid poolId ) { org.ovirt.engine.core.dao.StoragePoolIsoMapDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolIsoMapDAO.class ) ; org.mockito.Mockito.when ( db.getStoragePoolIsoMapDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( id , poolId ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( ) ) ; }

Target:
protected void expectGetIsAttached ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid poolId ) { org.ovirt.engine.core.dao.StoragePoolIsoMapDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolIsoMapDAO.class ) ; org.mockito.Mockito.when ( db.getStoragePoolIsoMapDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( id , poolId ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ; }
Source:
java.lang.String getContainerElementId ( com.google.gwt.cell.client.Cell.Context context ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( elementIdPrefix ) ; sb.append ( "_" ) ; sb.append ( ( ( columnId ) != null ? columnId : "col" + ( java.lang.String.valueOf ( context.getColumn ( ) ) ) ) ) ; sb.append ( "_row" ) ; sb.append ( java.lang.String.valueOf ( context.getIndex ( ) ) ) ; return sb.toString ( ) ; }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.safehtml.shared.SafeHtml value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { java.lang.String rawData = ( value != null ) ? value.asString ( ) : "" ; sb.append ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.template.textContainer ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) , getRenderedValue ( rawData ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , name , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , name , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }
Source:
public static void getHostPublicKey ( 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.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > bonds = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; allBonds = bonds ; initNicModels ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; queryFreeBonds ( ) ; }
Source:
public void removeMemoryFromActiveSnapshot ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_DUMP_DISK_ID , snapshot.getMemoryDiskId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_CONF_DISK_ID , snapshot.getMetadataDiskId ( ) ) ; dao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_VM_ID2 ) ; snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.Assert.assertNull ( snapshot.getMemoryDiskId ( ) ) ; org.junit.Assert.assertNull ( snapshot.getMetadataDiskId ( ) ) ; }

Target:
public void removeMemoryFromActiveSnapshot ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_DUMP_DISK_ID , snapshot.getMemoryDiskId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_MEMORY_CONF_DISK_ID , snapshot.getMetadataDiskId ( ) ) ; dao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_VM_ID2 ) ; snapshot = dao.get ( org.ovirt.engine.core.dao.SnapshotDaoTest.EXISTING_SNAPSHOT_ID2 ) ; org.junit.jupiter.api.Assertions.assertNull ( snapshot.getMemoryDiskId ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( snapshot.getMetadataDiskId ( ) ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.update ( getNic ( false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; control.replay ( ) ; try { resource.update ( getNic ( false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public 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 , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public 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 , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private boolean isHostedEngineVm ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String vmNameOnHost ) { org.ovirt.engine.core.common.businessentities.VmStatic dbVm = org.ovirt.engine.core.bll.AddUnmanagedVmsCommand.getVmStaticDao ( ) . get ( vmId ) ; return dbVm == null ? java.util.Objects.equals ( vmNameOnHost , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.HostedEngineVmName ) ) : ( dbVm.getOrigin ( ) ) == ( org.ovirt.engine.core.common.businessentities.OriginType.HOSTED_ENGINE ) ; }

Target:
private boolean isHostedEngineVm ( org.ovirt.engine.core.compat.Guid vmId , java.lang.String vmNameOnHost ) { org.ovirt.engine.core.common.businessentities.VmStatic dbVm = vmStaticDao.get ( vmId ) ; return dbVm == null ? java.util.Objects.equals ( vmNameOnHost , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.HostedEngineVmName ) ) : ( dbVm.getOrigin ( ) ) == ( org.ovirt.engine.core.common.businessentities.OriginType.HOSTED_ENGINE ) ; }
Source:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }

Target:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginUser : case LoginAdminUser : { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; } default : { return NotAutorizedError ( ) ; } } }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }
Source:
public java.lang.String getVdsName ( ) { if ( ( ( mVdsName ) == null ) && ( ( getVds ( ) ) != null ) ) { mVdsName = getVds ( ) . getName ( ) ; } return mVdsName ; }

Target:
public java.lang.String getVdsName ( ) { if ( ( mVdsName ) == null ) { if ( ( getVdsNoLoad ( ) ) == null ) { if ( ( getVdsStatic ( ) ) != null ) { mVdsName = getVdsStatic ( ) . getName ( ) ; } } else { if ( ( getVds ( ) ) != null ) { mVdsName = getVds ( ) . getName ( ) ; } } } return mVdsName ; }
Source:
public void testUpdateFieldsIsQuotaDefault ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaDefault ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaDefault ( false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota default statuses" , org.ovirt.engine.core.bll.VmTemplateHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsIsQuotaDefault ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaDefault ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaDefault ( false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota default statuses" , vmTemplateHandler.isUpdateValid ( src , dest ) ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVds , org.ovirt.engine.core.common.action.VdsActionParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVds , org.ovirt.engine.core.common.action.RemoveVdsParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; } if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , context.get ( ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }
Source:
public void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Cluster ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDSGroup > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.ClusterPredicate ( cluster.getId ( ) ) ) ) ; } }

Target:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Cluster ) ) ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDSGroup > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.ClusterPredicate ( cluster.getId ( ) ) ) ) ; } }
Source:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = getVmNicDao ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNicDao ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDao ( ) . remove ( iface.getId ( ) ) ; } } }

Target:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = getVmNicDao ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { removeFromExternalNetworks ( interfaces ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNicDao ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDao ( ) . remove ( iface.getId ( ) ) ; } } }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; tagsDirector.AddTag ( tag ) ; tag.settag_name ( "new name" ) ; tagsDirector.UpdateTag ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags fromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertEquals ( tag.gettag_name ( ) , fromDirector.gettag_name ( ) ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; tagsDirector.addTag ( tag ) ; tag.settag_name ( "new name" ) ; tagsDirector.UpdateTag ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags fromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertEquals ( tag.gettag_name ( ) , fromDirector.gettag_name ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > createImageList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid id : diskIds ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( id ) ; disks.add ( diskImage ) ; } return disks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createImageList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid id : diskIds ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setId ( id ) ; disks.add ( diskImage ) ; } return disks ; }
Source:
void registerModelEventListeners ( final org.ovirt.engine.ui.common.uicommon.model.ModelProvider < ? extends org.ovirt.engine.ui.uicommonweb.models.EntityModel > modelProvider ) { modelProvider.getModel ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.core.compat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) ; if ( "IsAvailable" . equals ( pcArgs.PropertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } } } ) ; }

Target:
void registerModelEventListeners ( final org.ovirt.engine.ui.common.uicommon.model.ModelProvider < ? extends org.ovirt.engine.ui.uicommonweb.models.EntityModel > modelProvider ) { modelProvider.getModel ( ) . 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 ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "IsAvailable" . equals ( pcArgs.PropertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } } } ) ; }
Source:
public void validateSucceedsOnUpVolume ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId1 ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void executeCommand ( ) { cmd.setGlusterVolumeId ( volumeId1 ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH , cmd.getAuditLogTypeValue ( ) ) ; org.mockito.Mockito.verify ( syncJob , org.mockito.Mockito.times ( 1 ) ) . refreshVolumeDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) ) ; }
Source:
public void testGetDefaultSortbyPhrase ( ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( true ) ; org.junit.Assert.assertTrue ( "HOST" , comp.getDefaultSort ( "HOST" ) . contains ( "vds_name" ) ) ; org.junit.Assert.assertEquals ( "Garbage" , "" , comp.getDefaultSort ( "kjfhkjdshkjfs" ) ) ; org.junit.Assert.assertEquals ( "Null" , "" , comp.getDefaultSort ( null ) ) ; }

Target:
public void setUp ( ) { comp = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( true ) ; }
Source:
public com.google.gwt.event.dom.client.HasClickHandlers addShutdownButton ( ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.constants.shutdownVm ( ) , org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.resources.stopIcon ( ) , org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.resources.stopDisabledIcon ( ) , style.shutdownButtonAdditionalStyle ( ) ) ; this . shutdownButton = button ; addButtonToPanel ( button ) ; return button ; }

Target:
public com.google.gwt.event.dom.client.HasClickHandlers addShutdownButton ( ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.constants.shutdownVm ( ) ) , org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.resources.stopIcon ( ) , org.ovirt.engine.ui.userportal.section.main.view.tab.basic.MainTabBasicListItemView.resources.stopDisabledIcon ( ) , style.shutdownButtonAdditionalStyle ( ) ) ; this . shutdownButton = button ; addButtonToPanel ( button ) ; return button ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }

Target:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.constants.importVmApplicationslSubTabLabel ( ) ) ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryGroup findDirectoryGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , java.lang.String namespace , final java.lang.String id , final boolean resolveGroups , final boolean resolveGroupsRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.aaa.DirectoryUtils.findDirectoryGroupsByIds ( extension , namespace , java.util.Arrays.asList ( id ) , resolveGroups , resolveGroupsRecursive ) ; if ( groups.isEmpty ( ) ) { return null ; } return groups.get ( 0 ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryGroup findDirectoryGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , java.lang.String namespace , final java.lang.String id , final boolean resolveGroups , final boolean resolveGroupsRecursive ) { java.util.Collection < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.aaa.DirectoryUtils.findDirectoryGroupsByIds ( extension , namespace , java.util.Arrays.asList ( id ) , resolveGroups , resolveGroupsRecursive ) ; if ( ( groups.size ( ) ) == 0 ) { return null ; } return new java.util.ArrayList < org.ovirt.engine.core.aaa.DirectoryGroup > ( groups ) . get ( 0 ) ; }
Source:
protected java.lang.Object [ ] getEncodedParameters ( java.lang.Object [ ] parameters , org.ovirt.engine.core.bll.adbroker.LdapGuidEncoder LdapGuidEncoder ) { if ( parameters == null ) { return null ; } java.lang.Object [ ] retVal = parameters.clone ( ) ; int index = 0 ; for ( java.lang.Object parameter : parameters ) { if ( parameter instanceof org.ovirt.engine.core.compat.Guid ) { retVal [ index ] = LdapGuidEncoder.encodeGuid ( ( ( org.ovirt.engine.core.compat.Guid ) ( parameter ) ) ) ; } index ++ ; } return retVal ; }

Target:
protected java.lang.Object [ ] getEncodedParameters ( java.lang.Object [ ] parameters , org.ovirt.engine.core.bll.adbroker.LdapIdEncoder idEncoder ) { if ( parameters == null ) { return null ; } java.lang.Object [ ] retVal = parameters.clone ( ) ; int index = 0 ; for ( java.lang.Object parameter : parameters ) { if ( parameter instanceof org.ovirt.engine.core.common.utils.ExternalId ) { retVal [ index ] = idEncoder.encodedId ( ( ( org.ovirt.engine.core.common.utils.ExternalId ) ( parameter ) ) ) ; } index ++ ; } return retVal ; }
Source:
private static java.lang.Double AssignDoubleValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.Double returnValue = null ; if ( input.containsKey ( name ) ) { java.lang.String stringValue = ( ( java.lang.String ) ( ( ( input.get ( name ) ) instanceof java.lang.String ) ? input.get ( name ) : null ) ) ; returnValue = ( stringValue == null ) ? null : java.lang.Double.parseDouble ( stringValue ) ; } return returnValue ; }

Target:
private static org.ovirt.engine.core.common.businessentities.GraphicsType parseGraphicsType ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.GraphicsType result = null ; try { java.lang.String displayTypeStr = xmlRpcStruct.get ( VdsProperties.displayType ) . toString ( ) ; switch ( displayTypeStr ) { case VdsProperties.VNC : result = org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ; break ; case VdsProperties.QXL : result = org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ; break ; } } catch ( java.lang.Exception e ) { } return result ; }
Source:
private void MigrationMode_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) == ( getMigrationMode ( ) . getSelectedItem ( ) ) ) { getHostCpu ( ) . setIsChangable ( true ) ; } else { getHostCpu ( ) . setEntity ( false ) ; getHostCpu ( ) . setIsChangable ( false ) ; } behavior.updateCpuPinningVisibility ( ) ; }

Target:
private void WatchdogModel_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "" . equals ( getWatchdogModel ( ) . getEntity ( ) ) ) { getWatchdogAction ( ) . setIsChangable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( "" ) ; } else { getWatchdogAction ( ) . setIsChangable ( true ) ; } }
Source:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }

Target:
public void validateInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }
Source:
public java.lang.String getButtonToolTip ( ) { if ( ( ! ( getModel ( ) . getIsCloneVmSupported ( ) ) ) && ( ( getModel ( ) . getEntity ( ) ) != null ) ) { org.ovirt.engine.core.common.queries.CommandVersionsInfo commandVersionsInfo = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getCommandVersionsInfo ( VdcActionType.AddVmFromSnapshot ) ; java.lang.String minimalClusterVersion = ( commandVersionsInfo != null ) ? commandVersionsInfo.getClusterVersion ( ) . toString ( 2 ) : "" ; return messages.cloneVmNotSupported ( minimalClusterVersion ) ; } else { return this . getTitle ( ) ; } }

Target:
public java.lang.String getButtonToolTip ( ) { if ( ( ! ( getModel ( ) . getIsCloneVmSupported ( ) ) ) && ( ( getModel ( ) . getEntity ( ) ) != null ) ) { org.ovirt.engine.core.common.queries.CommandVersionsInfo commandVersionsInfo = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getCommandVersionsInfo ( VdcActionType.AddVmFromSnapshot ) ; java.lang.String minimalClusterVersion = ( commandVersionsInfo != null ) ? commandVersionsInfo.getClusterVersion ( ) . toString ( 2 ) : "" ; return org.ovirt.engine.ui.common.widget.uicommon.vm.VmSnapshotListModelTable.messages.cloneVmNotSupported ( minimalClusterVersion ) ; } else { return this . getText ( ) ; } }
Source:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > snapshots = getAllImageSnapshots ( diskImage ) ; diskImage.getSnapshots ( ) . addAll ( snapshots ) ; } return validate ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) ; }

Target:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > snapshots = getAllImageSnapshots ( diskImage ) ; diskImage.getSnapshots ( ) . addAll ( snapshots ) ; } return validate ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) ; }
Source:
public void testGetAvalableValues ( ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.Set < java.lang.String > properties = new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "somevalue" ) ) ; org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( this , properties , values ) ; assertFalse ( properties.isEmpty ( ) ) ; assertEquals ( "Standard" , "Anakin" , values.get ( "somevalue" ) ) ; }

Target:
public void testGetAvailableValues ( ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.Set < java.lang.String > properties = new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( "somevalue" ) ) ; org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( this , properties , values ) ; assertFalse ( properties.isEmpty ( ) ) ; assertEquals ( "Standard" , "Anakin" , values.get ( "somevalue" ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; initNicModels ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; queryFreeBonds ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.RoleGroupMap getByActionGroupAndRole ( org.ovirt.engine.core.common.businessentities.ActionGroup group , org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "action_group_id" , group.getId ( ) ) . addValue ( "role_id" , id ) ; return getCallsHandler ( ) . executeRead ( "Get_roles_groups_By_action_group_id_And_By_role_id" , RoleGroupMapRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > getAllForRole ( org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "role_id" , id ) ; return getCallsHandler ( ) . executeReadList ( "Get_role_groups_By_role_id" , org.ovirt.engine.core.dao.RoleGroupMapDAODbFacadeImpl.RoleGroupMapRowMapper.instance , parameterSource ) ; }
Source:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.Disk disk ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.Disk disk ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.ImageTransfer model , org.ovirt.engine.api.model.ImageTransfer transform ) { assertNotNull ( transform ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; assertEquals ( model.getHost ( ) . getId ( ) , transform.getHost ( ) . getId ( ) ) ; assertEquals ( model.getImage ( ) . getId ( ) , transform.getImage ( ) . getId ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.ImageTransfer model , org.ovirt.engine.api.model.ImageTransfer transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getHost ( ) . getId ( ) , transform.getHost ( ) . getId ( ) ) ; org.junit.Assert.assertEquals ( model.getImage ( ) . getId ( ) , transform.getImage ( ) . getId ( ) ) ; }
Source:
public void testUpdate ( ) { updateExistingEntity ( ) ; dao.update ( existingEntity ) ; T result = dao.get ( existingEntity.getId ( ) ) ; org.ovirt.engine.core.dao.BaseGenericDaoTestCase.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingEntity , result ) ; }

Target:
public void testUpdate ( ) { updateExistingEntity ( ) ; dao.update ( existingEntity ) ; T result = dao.get ( existingEntity.getId ( ) ) ; org.ovirt.engine.core.dao.BaseGenericDaoTestCase.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingEntity , result ) ; verifyUpdate ( existingEntity , result ) ; }