auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.HostInterfaceValidator validator = new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( getNic ( ) ) ; return ( ( validate ( validator.interfaceExists ( ) ) ) && ( validate ( validator.interfaceAlreadyLabeledWith ( getLabel ( ) ) ) ) ) && ( validate ( validator.anotherInterfaceAlreadyLabeledWithThisLabel ( getLabel ( ) , getHostInterfaces ( ) ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.HostInterfaceValidator validator = new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( getNic ( ) ) ; return ( ( validate ( validator.interfaceExists ( ) ) ) && ( validate ( validator.interfaceAlreadyLabeledWith ( getLabel ( ) ) ) ) ) && ( validate ( validator.anotherInterfaceAlreadyLabeledWithThisLabel ( getLabel ( ) , getHostInterfaces ( ) ) ) ) ; }
Source:
private org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient getClient ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( this . client.isOpen ( ) ) { return this . client ; } this . client.connect ( ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcClient.ResponseTracker tracker = new org.ovirt.vdsm.jsonrpc.client.JsonRpcClient.ResponseTracker ( ) ; tracker.start ( ) ; return this . client ; }

Target:
private org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient getClient ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( this . client.isOpen ( ) ) { return this . client ; } this . client.connect ( ) ; return this . client ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { loginModel.resetAfterLogout ( ) ; user.onUserLogout ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel = null ; } } ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel = null ; } } ) ; }
Source:
public void validateSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public static void getStorageDomainList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getStorageDomainList ( 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.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( java.lang.String clusterId ) { org.ovirt.engine.core.compat.Guid dataCenterId = getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , null ) . getStoragePoolId ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( dataCenterId ) ) ; return getBackendCollection ( VdcQueryType.GetAllNetworks , params ) ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( java.lang.String clusterId ) { org.ovirt.engine.core.compat.Guid dataCenterId = getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , null ) . getStoragePoolId ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ; return getBackendCollection ( VdcQueryType.GetAllNetworks , params ) ; }
Source:
public void testAddForce ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( setUpGetMatrixConstraintsExpectations ( BackendResource.FORCE_CONSTRAINT , true , "true" , uriInfo , false ) ) ; setUpVolumeCreationExpectations ( true ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }

Target:
public void testAddForce ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( setUpGetMatrixConstraintsExpectations ( BackendResource.FORCE_CONSTRAINT , true , "true" , uriInfo ) ) ; setUpVolumeCreationExpectations ( true ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }
Source:
public final boolean IsFieldsUpdated ( java.lang.Object source , java.lang.Object destination , java.lang.Iterable < java.lang.String > fields ) { java.util.ArrayList < java.lang.String > changedFields = org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( source , destination ) ; for ( java.lang.String field : fields ) { if ( changedFields.contains ( field ) ) { return true ; } } return false ; }

Target:
public final boolean IsFieldsUpdated ( java.lang.Object source , java.lang.Object destination , java.lang.Iterable < java.lang.String > fields ) { java.util.List < java.lang.String > changedFields = org.ovirt.engine.core.utils.ObjectIdentityChecker.GetChangedFields ( source , destination ) ; for ( java.lang.String field : fields ) { if ( changedFields.contains ( field ) ) { return true ; } } return false ; }
Source:
public void onTimeout ( ) { if ( org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler._nonOperationalPools.containsKey ( poolId ) ) { try { org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( poolId ) ; if ( ( pool != null ) && ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.NonOperationalPoolTreatment ( pool ) ; } } catch ( java.lang.Exception e ) { } } }

Target:
public void onTimeout ( ) { if ( org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler._nonOperationalPools.containsKey ( poolId ) ) { try { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( poolId ) ; if ( ( pool != null ) && ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.NonOperationalPoolTreatment ( pool ) ; } } catch ( java.lang.Exception e ) { } } }
Source:
protected void userVisibleLog ( java.util.logging.Level level , java.lang.String message ) { if ( java.util.logging.Level.SEVERE.equals ( level ) ) { org.ovirt.engine.core.bll.hostdeploy.VdsDeployBase.log.error ( message ) ; } else if ( java.util.logging.Level.WARNING.equals ( level ) ) { org.ovirt.engine.core.bll.hostdeploy.VdsDeployBase.log.warn ( message ) ; } else if ( java.util.logging.Level.INFO.equals ( level ) ) { org.ovirt.engine.core.bll.hostdeploy.VdsDeployBase.log.info ( message ) ; } else { org.ovirt.engine.core.bll.hostdeploy.VdsDeployBase.log.debug ( message ) ; } }

Target:
public void userVisibleLog ( java.util.logging.Level level , java.lang.String message ) { if ( java.util.logging.Level.SEVERE.equals ( level ) ) { org.ovirt.engine.core.bll.hostdeploy.VdsDeployBase.log.error ( message ) ; } else if ( java.util.logging.Level.WARNING.equals ( level ) ) { org.ovirt.engine.core.bll.hostdeploy.VdsDeployBase.log.warn ( message ) ; } else if ( java.util.logging.Level.INFO.equals ( level ) ) { org.ovirt.engine.core.bll.hostdeploy.VdsDeployBase.log.info ( message ) ; } else { org.ovirt.engine.core.bll.hostdeploy.VdsDeployBase.log.debug ( message ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachment ( networkA , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.setNicId ( nic.getId ( ) ) ; attachment.setNicName ( nic.getName ( ) ) ; return attachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { return createNetworkAttachment ( networkA , nic , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData getDiskImportData ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = diskImportDataMap.get ( diskId ) ; if ( importData != null ) { if ( ( storage.getSelectedItem ( ) ) == null ) { importData.setSelectedStorageDomain ( ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( storage.getSelectedItem ( ) ) ) ) ; } } return importData ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData getDiskImportData ( org.ovirt.engine.core.compat.Guid diskId ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = diskImportDataMap.get ( diskId ) ; if ( importData != null ) { if ( ( storage.getSelectedItem ( ) ) == null ) { importData.setSelectedStorageDomain ( ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( storage.getSelectedItem ( ) ) ) ) ; } } return importData ; }
Source:
public void VdsNameVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVdsName ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setvds_name ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVds ( v ) ; final java.lang.String s = b.getVdsName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }

Target:
public void VdsNameVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVdsName ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setVdsName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVds ( v ) ; final java.lang.String s = b.getVdsName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.MigrateVmCommand.getActionReturnValue ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_DONE : org.ovirt.engine.core.bll.MigrateVmCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START : _isRerun ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_TRYING_RERUN : ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTANANCE : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.MigrateVmCommand.getActionReturnValue ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_DONE : org.ovirt.engine.core.bll.MigrateVmCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START : _isRerun ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_TRYING_RERUN : ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTANANCE : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getEntry ( widget ) . swapButton ( createButton ( item ) ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getEntry ( widget ) . swapButton ( createButton ( item , false ) ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { if ( user.isAdmin ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.admin ( ) ) ; } if ( user.isGroup ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.group ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.user ( ) ) ; }

Target:
public java.lang.String getTooltip ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { if ( user.isAdmin ( ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.admin ( ) ; } if ( user.isGroup ( ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.group ( ) ; } return org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.user ( ) ; }
Source:
public void testAddIscsiLunDiskIncompleteParametersConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionAddress" , "address" ) ; } }

Target:
public void testAddIscsiLunDiskIncompleteParametersConnectionAddress ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setAddress ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddIscsiLunDiskIncompleteParametersConnectionAddress" , "address" ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel consoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ( model ) ) ; this . host = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; consoleModel.setAndInvokeClient ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { this . host = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; this . setAndInvokeClient ( ) ; }
Source:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
public org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( ) { return super . getVdsGroup ( ) ; }
Source:
protected void updateVirtioScsiAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean isVirtioScsiEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , cluster.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getModel ( ) . getIsVirtioScsiEnabled ( ) . setIsAvailable ( isVirtioScsiEnabled ) ; }

Target:
protected void updateVirtioScsiAvailability ( ) { boolean isVirtioScsiEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , getModel ( ) . getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getModel ( ) . getIsVirtioScsiEnabled ( ) . setIsAvailable ( isVirtioScsiEnabled ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( adminRole.getEntity ( ) ) == true ) { adminRadioButtonEditor.setValue ( true ) ; } else { userRadioButtonEditor.setValue ( true ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( adminRole.getEntity ( ) ) { adminRadioButtonEditor.setValue ( true ) ; } else { userRadioButtonEditor.setValue ( true ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; java.lang.String memoryVolume = ( ( activeSnapshot != null ) && ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) ) ? activeSnapshot.getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , memoryVolume , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; java.lang.String memoryVolume = ( ( activeSnapshot != null ) && ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . isImportAsNewEntity ( ) ) ) ) ? activeSnapshot.getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , memoryVolume , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase RunActionWithinThreadCompat ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase actionParameters ) { try { java.util.concurrent.CountDownLatch latch = new java.util.concurrent.CountDownLatch ( 1 ) ; org.ovirt.engine.core.bll.RegisterVdsQuery < P > . WaitCallback cb = new WaitCallback ( latch , actionType , actionParameters ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( cb ) ; try { latch.await ( ) ; } catch ( java.lang.InterruptedException e ) { } return cb.getReturnValue ( ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.RegisterVdsQuery.log.error ( "RegisterVdsQuery::RunCommandWithinThread: An exception has been thrown." , ex ) ; return null ; } }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase RunActionWithinThreadCompat ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase actionParameters ) { try { java.util.concurrent.CountDownLatch latch = new java.util.concurrent.CountDownLatch ( 1 ) ; org.ovirt.engine.core.bll.RegisterVdsQuery < P > . WaitCallback cb = new WaitCallback ( latch , actionType , actionParameters ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( cb ) ; try { latch.await ( ) ; } catch ( java.lang.InterruptedException e ) { } return cb.getReturnValue ( ) ; } catch ( java.lang.RuntimeException ex ) { log.error ( "RegisterVdsQuery::RunCommandWithinThread: An exception has been thrown." , ex ) ; return null ; } }
Source:
private void removeVmStatlessImages ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeVmStatlessImages ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , true ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . validate ( ) ) ) { return false ; } boolean isVolumeDistributed = glusterVolume.getVolumeType ( ) . isDistributedType ( ) ; if ( ! isVolumeDistributed ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NOT_DISTRIBUTED ) ; } else if ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRebalance ( glusterVolume ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . validate ( ) ) ) { return false ; } boolean isVolumeDistributed = glusterVolume.getVolumeType ( ) . isDistributedType ( ) ; if ( ! isVolumeDistributed ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NOT_DISTRIBUTED ) ; } else if ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK ) ; } return validate ( brickValidator.canRebalance ( glusterVolume ) ) ; }
Source:
private static boolean handlesEvent ( com.google.gwt.view.client.CellPreviewEvent < org.ovirt.engine.ui.uicommonweb.models.EntityModel > event ) { com.google.gwt.dom.client.NativeEvent nativeEvent = event.getNativeEvent ( ) ; if ( ! ( BrowserEvents.CLICK.equals ( nativeEvent.getType ( ) ) ) ) { return false ; } com.google.gwt.dom.client.Element target = nativeEvent.getEventTarget ( ) . cast ( ) ; return "input" . equals ( target.getTagName ( ) . toLowerCase ( ) ) ; }

Target:
static boolean handlesEvent ( com.google.gwt.view.client.CellPreviewEvent < org.ovirt.engine.ui.uicommonweb.models.EntityModel > event ) { com.google.gwt.dom.client.NativeEvent nativeEvent = event.getNativeEvent ( ) ; if ( ! ( BrowserEvents.CLICK.equals ( nativeEvent.getType ( ) ) ) ) { return false ; } com.google.gwt.dom.client.Element target = nativeEvent.getEventTarget ( ) . cast ( ) ; return "input" . equals ( target.getTagName ( ) . toLowerCase ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > getAllForStorageDomainByEntityType ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.VmEntityType entityType ) { return getCallsHandler ( ) . executeReadList ( "GetAllOVFEntitiesForStorageDomainByEntityType" , org.ovirt.engine.core.dao.UnregisteredOVFDataDAODbFacadeImpl.OvfEntityDataRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_domain_id" , storageDomainId ) . addValue ( "entity_type" , entityType.name ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > getAllForStorageDomainByEntityType ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.VmEntityType entityType ) { return getCallsHandler ( ) . executeReadList ( "GetAllOVFEntitiesForStorageDomainByEntityType" , org.ovirt.engine.core.dao.UnregisteredOVFDataDAODbFacadeImpl.OvfEntityDataRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_domain_id" , storageDomainId ) . addValue ( "entity_type" , ( entityType != null ? entityType.name ( ) : null ) ) ) ; }
Source:
protected void endVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { this . vmStaticDao.incrementDbGeneration ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getId ( ) ) ; } endActionOnDisks ( ) ; unlockVm ( ) ; org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) { vmStaticDao.incrementDbGeneration ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getId ( ) ) ; } endActionOnDisks ( ) ; unlockVm ( ) ; org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; }
Source:
private static org.ovirt.engine.core.bll.EntityMultiAsyncTasks GetEntityMultiAsyncTasksByContainerId ( java.lang.Object containerID ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks entityInfo = null ; synchronized ( org.ovirt.engine.core.bll.EntityAsyncTask._lockObject ) { if ( ( org.ovirt.engine.core.bll.EntityAsyncTask._multiTasksByEntities.containsKey ( containerID ) ) && ( ( org.ovirt.engine.core.bll.EntityAsyncTask._multiTasksByEntities.get ( containerID ) ) != null ) ) { entityInfo = org.ovirt.engine.core.bll.EntityAsyncTask._multiTasksByEntities.get ( containerID ) ; } } return entityInfo ; }

Target:
private static org.ovirt.engine.core.bll.EntityMultiAsyncTasks GetEntityMultiAsyncTasksByContainerId ( java.lang.Object containerID ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks entityInfo = null ; synchronized ( org.ovirt.engine.core.bll.EntityAsyncTask._lockObject ) { entityInfo = org.ovirt.engine.core.bll.EntityAsyncTask._multiTasksByEntities.get ( containerID ) ; } return entityInfo ; }
Source:
private static boolean updateDiskProfileForBackwardCompatibility ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > diskProfilesList , java.util.Set < org.ovirt.engine.core.compat.Guid > permittedDiskProfilesIds , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile : diskProfilesList ) { if ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.isDiskProfilePermitted ( diskProfile , permittedDiskProfilesIds , user ) ) { permittedDiskProfilesIds.add ( diskProfile.getId ( ) ) ; diskImage.setDiskProfileId ( diskProfile.getId ( ) ) ; return true ; } } return false ; }

Target:
private boolean updateDiskProfileForBackwardCompatibility ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , java.util.List < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > diskProfilesList , java.util.Set < org.ovirt.engine.core.compat.Guid > permittedDiskProfilesIds , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile diskProfile : diskProfilesList ) { if ( isDiskProfilePermitted ( diskProfile , permittedDiskProfilesIds , user ) ) { permittedDiskProfilesIds.add ( diskProfile.getId ( ) ) ; diskImage.setDiskProfileId ( diskProfile.getId ( ) ) ; return true ; } } return false ; }
Source:
public void testVmInPreview ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW.name ( ) ) ) ; }

Target:
public void testVmInPreview ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW.name ( ) ) ) ; }
Source:
public void setup ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.mockito.Mockito.when ( osRepository.getUniqueOsNames ( ) ) . thenReturn ( java.util.Collections.emptyMap ( ) ) ; initVm ( ) ; images = new java.util.ArrayList < > ( ) ; emulatedMachine = "pc" ; cpuId = "SandyBridge" ; underTest = new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , images , version , emulatedMachine , cpuId ) ; }

Target:
public void setup ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; initVm ( ) ; images = new java.util.ArrayList < > ( ) ; emulatedMachine = "pc" ; cpuId = "SandyBridge" ; underTest = new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , images , version , emulatedMachine , cpuId ) ; }
Source:
public static 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 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 ) ; }
Source:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImageById , org.ovirt.engine.core.common.queries.GetImageByIdParameters.class , new java.lang.String [ ] { "StorageDomainId" , "RepoImageId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.IMAGE_ID.toString ( ) } , getEntity ( 1 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Image image = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.verifyModelSpecific ( image , 1 ) ; verifyLinks ( image ) ; }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImageById , org.ovirt.engine.core.common.queries.GetImageByIdParameters.class , new java.lang.String [ ] { "StorageDomainId" , "RepoImageId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.IMAGE_ID.toString ( ) } , getEntity ( 1 ) ) ; org.ovirt.engine.api.model.Image image = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainImageResourceTest.verifyModelSpecific ( image , 1 ) ; verifyLinks ( image ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = null ; if ( ( ( ! ( getModel ( ) . isVmDown ( ) ) ) && ( getModel ( ) . isHotPlugAvailable ( ) ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { tooltip = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ) ; } return tooltip ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = null ; if ( ( getModel ( ) . isHotPlugAvailable ( ) ) && ( ! ( getModel ( ) . getIsDiskHotPlugSupported ( ) ) ) ) { tooltip = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ) ; } return tooltip ; }
Source:
public void setup ( ) { org.mockito.Mockito.when ( version.getValue ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VmNicValidatorTest.CLUSTER_VERSION ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmNicValidator ( nic , version ) ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( validator ) . getDbFacade ( ) ; }

Target:
public void setup ( ) { org.mockito.Mockito.when ( version.getValue ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VmNicValidatorTest.CLUSTER_VERSION ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmNicValidator ( nic , version ) ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( validator ) . getDbFacade ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) ; if ( isImageProvided ( ) ) { return validateImageTransfer ( imageId ) ; } else if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Download ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_NOT_SPECIFIED_FOR_DOWNLOAD ) ; } return validateCreateImage ( ) ; }

Target:
protected boolean validate ( ) { if ( isImageProvided ( ) ) { return validateImageTransfer ( ) ; } else if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Download ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_NOT_SPECIFIED_FOR_DOWNLOAD ) ; } return validateCreateImage ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VolumeFormat getDiskVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; } else if ( storageType.isBlockDomain ( ) ) { switch ( volumeType ) { case Sparse : return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; case Preallocated : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } } else { return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } }

Target:
public org.ovirt.engine.core.common.businessentities.VolumeFormat getDiskVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; } else if ( storageType.isBlockDomain ( ) ) { switch ( volumeType ) { case Sparse : return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; case Preallocated : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } } else { return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getVm ( ) . getDynamicData ( ) , getVm ( ) . getStatus ( ) ) ; getVm ( ) . setStatus ( VMStatus.PreparingForHibernate ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( getVdsId ( ) , getVm ( ) . getDynamicData ( ) ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getVm ( ) . getDynamicData ( ) ) ; getVm ( ) . setStatus ( VMStatus.PreparingForHibernate ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( getVdsId ( ) , getVm ( ) . getDynamicData ( ) ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public org.ovirt.engine.core.compat.Guid getUserId ( ) { if ( ( ( ( mUserId ) != null ) && ( mUserId.equals ( Guid.Empty ) ) ) && ( ( getCurrentUser ( ) ) != null ) ) { mUserId = getCurrentUser ( ) . getUserId ( ) ; } return mUserId ; }

Target:
public org.ovirt.engine.core.compat.Guid getUserId ( ) { if ( ( ( ( mUserId ) != null ) && ( mUserId.equals ( Guid.Empty ) ) ) && ( ( getCurrentUser ( ) ) != null ) ) { mUserId = getCurrentUser ( ) . getId ( ) ; } return mUserId ; }
Source:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.validator.ImportValidator importValidator = org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getImportValidator ( ) ; if ( ! ( validate ( importValidator.validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getImages ( ) ) ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getStorageDomain ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.validator.ImportValidator importValidator = org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getImportValidator ( ) ; if ( ! ( validate ( importValidator.validateUnregisteredEntity ( vmFromConfiguration , ovfEntityData , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getImages ( ) ) ) ) ) { return false ; } setImagesWithStoragePoolId ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getImages ( ) ) ; } return super . canDoAction ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsName ( host.getName ( ) ) ; vds.setHostName ( host.getIp ( ) ) ; hosts.add ( vds ) ; } return hosts ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsName ( host.getName ( ) ) ; vds.setHostName ( host.getName ( ) ) ; hosts.add ( vds ) ; } return hosts ; }