auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { validateParameters ( cluster , getMandatoryParameters ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( cluster ) ; return performCreate ( ActionType.AddCluster , createAddCommandParams ( cluster , dataCenter ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { validateParameters ( cluster , getMandatoryParameters ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( cluster ) ; return performCreate ( ActionType.AddCluster , createAddCommandParams ( cluster , dataCenter ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
protected boolean canDoAction ( ) { slaveVolume = getSlaveVolume ( ) ; if ( ( slaveVolume ) != null ) { setGlusterVolumeId ( slaveVolume.getId ( ) ) ; setVdsGroupId ( slaveVolume.getClusterId ( ) ) ; } else { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; } if ( ( slaveVolume.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean validate ( ) { slaveVolume = getSlaveVolume ( ) ; if ( ( slaveVolume ) != null ) { setGlusterVolumeId ( slaveVolume.getId ( ) ) ; setVdsGroupId ( slaveVolume.getClusterId ( ) ) ; } else { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; } if ( ( slaveVolume.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED ) ; } return super . validate ( ) ; }
Source:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessage ( java.lang.String.format ( "$vmsList %1$s" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ) ; return false ; } return true ; }

Target:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessageVariable ( "vmsList" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ; return false ; } return true ; }
Source:
public void getDiskList ( 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.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public void invalidAuthenticationPassword ( ) { org.mockito.Mockito.when ( provider.isRequiringAuthentication ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( provider.getUsername ( ) ) . thenReturn ( "user" ) ; org.junit.Assert.assertThat ( validator.validateAuthentication ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_NO_PASSWORD ) ) ; }

Target:
public void invalidAuthenticationPassword ( ) { org.mockito.Mockito.when ( provider.isRequiringAuthentication ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( provider.getUsername ( ) ) . thenReturn ( "user" ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validateAuthentication ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_NO_PASSWORD ) ) ; }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDestroyCommand ( ) ) ) { return destroyConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand.getName ( ) . equals ( "OnSave" ) ) { return forceCreateConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDestroyCommand ( ) ) ) { return destroyConfirmPopupProvider.get ( ) ; } else if ( ( lastExecutedCommand.getName ( ) . equals ( "OnSave" ) ) || ( lastExecutedCommand.getName ( ) . equals ( "OnImport" ) ) ) { return forceCreateConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
protected void addCustomModelsDetailModelList ( org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel diskListModel = new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ( ) ; diskListModel.setSystemTreeContext ( this ) ; list.add ( 3 , diskListModel ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateEventListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; }

Target:
protected void addCustomModelsDetailModelList ( final java.util.List < org.ovirt.engine.ui.uicommonweb.models.HasEntity < org.ovirt.engine.core.common.businessentities.VmTemplate > > list , int customPosition , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel templateDiskListModel , final org.ovirt.engine.ui.uicommonweb.models.templates.TemplateEventListModel templateEventListModel , final org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel < org.ovirt.engine.core.common.businessentities.VmTemplate > permissionListModel ) { templateDiskListModel.setSystemTreeContext ( this ) ; list.add ( customPosition , templateDiskListModel ) ; list.add ( templateEventListModel ) ; list.add ( permissionListModel ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.Disk disk = null ; org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType diskStorageType = Disk.DiskStorageType.forValue ( rs.getInt ( "disk_storage_type" ) ) ; switch ( diskStorageType ) { case IMAGE : disk = DiskImageRowMapper.instance.mapRow ( rs , rowNum ) ; break ; case LUN : disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.LunDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; } return disk ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.Disk disk = null ; org.ovirt.engine.core.common.businessentities.storage.DiskStorageType diskStorageType = org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.forValue ( rs.getInt ( "disk_storage_type" ) ) ; switch ( diskStorageType ) { case IMAGE : disk = DiskImageRowMapper.instance.mapRow ( rs , rowNum ) ; break ; case LUN : disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.LunDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; case CINDER : disk = CinderDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; } return disk ; }
Source:
public static void GetRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( roleId ) , aQuery ) ; }

Target:
public static void GetDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDataCentersWithPermittedActionOnClusters , getEntitiesWithPermittedActionParameters , aQuery ) ; }
Source:
public void setLocalItem ( java.lang.String key , java.lang.String value ) { if ( ( org.ovirt.engine.ui.common.system.ClientStorageImpl.localStorage ) != null ) { org.ovirt.engine.ui.common.system.ClientStorageImpl.localStorage.setItem ( key , value ) ; } else { com.google.gwt.user.client.Cookies.setCookie ( key , value , new java.util.Date ( ( ( new java.util.Date ( ) . getTime ( ) ) + ( org.ovirt.engine.ui.common.system.ClientStorageImpl.PERSISTENT_COOKIE_EXPIRATION ) ) ) ) ; } }

Target:
void setLocalItemImpl ( java.lang.String key , java.lang.String value ) { if ( ( org.ovirt.engine.ui.common.system.ClientStorageImpl.localStorage ) != null ) { org.ovirt.engine.ui.common.system.ClientStorageImpl.localStorage.setItem ( key , value ) ; } else { com.google.gwt.user.client.Cookies.setCookie ( key , value , new java.util.Date ( ( ( new java.util.Date ( ) . getTime ( ) ) + ( org.ovirt.engine.ui.common.system.ClientStorageImpl.PERSISTENT_COOKIE_EXPIRATION ) ) ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session : georepSessions ) { if ( ( ( session.getSlaveVolumeId ( ) ) == null ) || ( ( session.getSlaveNodeUuid ( ) ) == null ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE ) ; } } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session : georepSessions ) { if ( ( ( session.getSlaveVolumeId ( ) ) == null ) || ( ( session.getSlaveNodeUuid ( ) ) == null ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE ) ; } } return true ; }
Source:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , setNetwork ( nic , entity ) ) ; }

Target:
void addReportedDevices ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.List < org.ovirt.engine.api.model.Device > devices = getDevices ( entity.getVmId ( ) . getValue ( ) , entity.getMacAddress ( ) ) ; if ( ! ( devices.isEmpty ( ) ) ) { org.ovirt.engine.api.model.ReportedDevices reportedDevices = new org.ovirt.engine.api.model.ReportedDevices ( ) ; reportedDevices.getReportedDevices ( ) . addAll ( devices ) ; model.setReportedDevices ( reportedDevices ) ; } }
Source:
public 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:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public static void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
private void writeCleanup ( ) { logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( model.getEditorType ( ) . getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; java.util.Set < java.lang.String > modelExpressions = getModelCleanupExpressions ( ) ; if ( ! ( modelExpressions.isEmpty ( ) ) ) { sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; for ( java.lang.String expr : modelExpressions ) { sw.println ( java.lang.String.format ( "%s.cleanup();" , expr ) ) ; } sw.outdent ( ) ; sw.println ( "}" ) ; } java.util.Set < java.lang.String > editorFieldExpressions = getEditorFieldCleanupExpressions ( ) ; for ( java.lang.String expr : editorFieldExpressions ) { sw.println ( java.lang.String.format ( "if (%s != null) {" , expr ) ) ; sw.indent ( ) ; sw.println ( java.lang.String.format ( "%s.cleanup();" , expr ) ) ; sw.outdent ( ) ; sw.println ( "}" ) ; } sw.outdent ( ) ; sw.println ( "}" ) ; }

Target:
private void writeCleanup ( ) { logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( model.getEditorType ( ) . getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; java.util.Set < java.lang.String > editorFieldExpressions = getEditorFieldCleanupExpressions ( ) ; for ( java.lang.String expr : editorFieldExpressions ) { sw.println ( java.lang.String.format ( "if (%s != null) {" , expr ) ) ; sw.indent ( ) ; sw.println ( java.lang.String.format ( "%s.cleanup();" , expr ) ) ; sw.outdent ( ) ; sw.println ( "}" ) ; } java.util.Set < java.lang.String > modelExpressions = getModelCleanupExpressions ( ) ; if ( ! ( modelExpressions.isEmpty ( ) ) ) { sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; for ( java.lang.String expr : modelExpressions ) { sw.println ( java.lang.String.format ( "%s.cleanup();" , expr ) ) ; } sw.outdent ( ) ; sw.println ( "}" ) ; } sw.outdent ( ) ; sw.println ( "}" ) ; }
Source:
public void getMigrationPolicies ( 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 returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.migration.MigrationPolicy > ( ) ; } return returnValue ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllMigrationPolicies , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void testAllLunsHaveDiscardZeroesTheDataSupportFailsOneLunHasNullValue ( ) { org.junit.Assert.assertFalse ( discardHelper.allLunsHaveDiscardZeroesTheDataSupport ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , null ) ) ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { storageDomain.setSupportsDiscard ( true ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
private static void initIscsiBondSeverities ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_REMOVE_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_REMOVE_FAILED , AuditLogSeverity.ERROR ) ; }

Target:
private static void initIscsiBondSeverities ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_REMOVE_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_REMOVE_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_ISCSI_BOND_HOST_RESTART_WARNING , AuditLogSeverity.WARNING ) ; }
Source:
protected void disableElement ( com.google.gwt.dom.client.Element element ) { element.getStyle ( ) . setProperty ( "disabled" , "true" ) ; element.getStyle ( ) . setColor ( "#999999" ) ; if ( ( getNodeDisabledTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( getNodeDisabledTooltip ( ) ) , element ) ; } }

Target:
protected void disableElement ( com.google.gwt.dom.client.Element element ) { element.getStyle ( ) . setProperty ( "disabled" , "true" ) ; element.getStyle ( ) . setColor ( "#999999" ) ; if ( ( getNodeDisabledTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.ElementTooltipUtils.setTooltipOnElement ( getNodeDisabledTooltip ( ) , element ) ; } }
Source:
public void setCpus ( int totalCpus , int usedPercentage ) { java.lang.String totalCpusString = messages.numaTotalCpus ( totalCpus ) ; totalLabel.setTitle ( totalCpusString ) ; totalLabel.setText ( totalCpusString ) ; java.lang.String percentageUsed = messages.numaPercentUsed ( usedPercentage ) ; percentageLabel.setTitle ( percentageUsed ) ; percentageLabel.setText ( percentageUsed ) ; }

Target:
public void setCpus ( int totalCpus , int usedPercentage ) { java.lang.String totalCpusString = org.ovirt.engine.ui.common.view.popup.numa.CpuSummaryPanel.messages.numaTotalCpus ( totalCpus ) ; totalLabel.setTitle ( totalCpusString ) ; totalLabel.setText ( totalCpusString ) ; java.lang.String percentageUsed = org.ovirt.engine.ui.common.view.popup.numa.CpuSummaryPanel.messages.numaPercentUsed ( usedPercentage ) ; percentageLabel.setTitle ( percentageUsed ) ; percentageLabel.setText ( percentageUsed ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isShareable ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.shareable ( ) ) ; } return null ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return disk.getDiskDescription ( ) ; }
Source:
public void run ( ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryResult discoveryResult = org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerFactory.getInstance ( ) . runDiscover ( ) ; if ( discoveryResult != null ) { updateDB ( discoveryResult ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread.log.info ( "PolicyUnits updated" ) ; } else { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread.log.warn ( "Discovery returned empty result, not updating policyunits" ) ; } }

Target:
public void run ( ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryResult discoveryResult = org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerFactory.getInstance ( ) . runDiscover ( ) ; if ( discoveryResult != null ) { updateDB ( discoveryResult ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread.log.info ( "PolicyUnits updated" ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase loggable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( loggable , AuditLogType.FAILED_TO_CONNECT_TO_SCHEDULER_PROXY ) ; markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread.log.warn ( "Discovery returned empty result, disabled external policy units" ) ; } }
Source:
protected org.ovirt.engine.core.bll.VmRunHandler getVmRunHandler ( ) { return org.ovirt.engine.core.bll.VmRunHandler.getInstance ( ) ; }

Target:
public void reportCompleted ( ) { final boolean isRunAndPaused = ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; if ( isRunAndPaused ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , true ) ; } else { super . reportCompleted ( ) ; } }
Source:
private void UpdateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) . getValue ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . update ( vmDynamicData ) ; } }

Target:
private void updateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) . getValue ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . update ( vmDynamicData ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc powerDown ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.shutdown ( vmId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public java.util.concurrent.Future < java.util.Map < java.lang.String , java.lang.Object > > setupNetworks ( java.util.Map networks , java.util.Map bonds , java.util.Map options ) { return vdsServer.futureSetupNetworks ( networks , bonds , options ) ; }
Source:
public void nonLocalStoragePoolAttachedToSingleCluster ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ) ; org.junit.Assert.assertThat ( validator.localStoragePoolAttachedToSingleCluster ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nonLocalStoragePoolAttachedToSingleCluster ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.localStoragePoolAttachedToSingleCluster ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { removeVmFromDb ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { removeVmFromDb ( ) ; if ( getParameters ( ) . isRemoveDisks ( ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : diskImages ) { getCompensationContext ( ) . snapshotEntityStatus ( image.getImage ( ) , ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( image.getImage ( ) . getId ( ) , ImageStatus.LOCKED ) ; } getCompensationContext ( ) . stateChanged ( ) ; } return null ; }
Source:
private org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( org.ovirt.engine.core.common.businessentities.VM dbVm , java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct , java.lang.Double notifyTime ) { return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmDynamicFromEvent ( dbVm.getDynamicData ( ) , xmlRpcStruct ) , dbVm.getStatisticsData ( ) , notifyTime ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( org.ovirt.engine.core.common.businessentities.VM dbVm , java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct , java.lang.Double notifyTime ) { org.ovirt.engine.core.common.businessentities.VmDynamic clonedVmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( dbVm.getDynamicData ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( clonedVmDynamic , xmlRpcStruct , vdsManager.getCopyVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( clonedVmDynamic , dbVm.getStatisticsData ( ) , notifyTime ) ; }
Source:
void addStyles ( ) { linuxBootOptionsPanel.setVisible ( false ) ; windowsSysprepPanel.setVisible ( false ) ; attachFloppyEditor.addContentWidgetStyleName ( style.attachImageCheckBoxLabel ( ) ) ; attachIsoEditor.addContentWidgetStyleName ( style.attachImageCheckBoxLabel ( ) ) ; floppyImageEditor.addLabelStyleName ( style.attachImageSelectBoxLabel ( ) ) ; isoImageEditor.addLabelStyleName ( style.attachImageSelectBoxLabel ( ) ) ; }

Target:
void addStyles ( ) { linuxBootOptionsPanel.setVisible ( false ) ; windowsSysprepPanel.setVisible ( false ) ; attachFloppyEditor.addContentWidgetStyleName ( style.attachImageCheckBoxLabel ( ) ) ; attachIsoEditor.addContentWidgetStyleName ( style.attachImageCheckBoxLabel ( ) ) ; floppyImageEditor.addLabelStyleName ( style.attachImageSelectBoxLabel ( ) ) ; isoImageEditor.addLabelStyleName ( style.attachImageSelectBoxLabel ( ) ) ; floppyImageEditor.addContentWidgetStyleName ( style.attachImageSelectbox ( ) ) ; isoImageEditor.addContentWidgetStyleName ( style.attachImageSelectbox ( ) ) ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected boolean isDomainInEditState ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isEditable = ( storageDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) || ( ( storageDomain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) ) ; return isEditable ; }

Target:
private boolean isFileDomainInEditState ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { return ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) || ( ( storageDomain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) ; }
Source:
public void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections iscsiConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( iscsiConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( iscsiConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }

Target:
public void updateISCSIConnectionEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_IQN ) ; }
Source:
public static void GetWANColorDepth ( 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 ? org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.depth16 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getWANColorDepth ( 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 ? org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.depth16 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult localStoragePoolAttachedToSingleCluster ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.VDS_GROUP_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) . when ( ( ( ( dataCenter != null ) && ( dataCenter.isLocal ( ) ) ) && ( ! ( clusterDao.getAllForStoragePool ( cluster.getStoragePoolId ( ) ) . isEmpty ( ) ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult localStoragePoolAttachedToSingleCluster ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_GROUP_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) . when ( ( ( ( dataCenter != null ) && ( dataCenter.isLocal ( ) ) ) && ( ! ( clusterDao.getAllForStoragePool ( cluster.getStoragePoolId ( ) ) . isEmpty ( ) ) ) ) ) ; }
Source:
public void testMoveById ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true , null , null , true ) ) ; verifyActionResponse ( resource.move ( setUpParams ( false ) ) , ( "disks/" + ( org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID ) ) , false ) ; }

Target:
public void testMoveById ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true , null , null , true ) ) ; verifyActionResponse ( resource.move ( setUpParams ( false ) ) , ( "disks/" + ( org.ovirt.engine.api.restapi.resource.BackendDiskResourceTest.DISK_ID ) ) , false ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService createServerService ( org.ovirt.engine.core.compat.Guid serverId , org.ovirt.engine.core.compat.Guid serviceId , java.lang.String serviceName , org.ovirt.engine.core.common.businessentities.gluster.GlusterServiceStatus status ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; service.setServerId ( serverId ) ; service.setServiceId ( serviceId ) ; service.setStatus ( status ) ; service.setServiceName ( serviceName ) ; return service ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService createServerService ( org.ovirt.engine.core.compat.Guid serverId , org.ovirt.engine.core.compat.Guid serviceId , java.lang.String serviceName , org.ovirt.engine.core.common.businessentities.gluster.GlusterServiceStatus status ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; service.setServerId ( serverId ) ; service.setServiceId ( serviceId ) ; service.setStatus ( status ) ; service.setServiceName ( serviceName ) ; return service ; }