auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { struct.put ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.put ( VdsProperties.Index , "0" ) ; struct.put ( VdsProperties.INTERFACE , VdsProperties.Fdc ) ; struct.put ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; struct.put ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }

Target:
private static void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { struct.put ( VdsProperties.Type , vmDevice.getType ( ) . getValue ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.put ( VdsProperties.Index , "0" ) ; struct.put ( VdsProperties.INTERFACE , VdsProperties.Fdc ) ; struct.put ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; struct.put ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { addDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( "AddDisk" . equals ( command.getName ( ) ) ) { addDisk ( ) ; } if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
protected < T > java.util.concurrent.FutureTask < T > scheduleTask ( java.util.concurrent.Callable < T > callable ) { final java.util.concurrent.FutureTask < T > task = new java.util.concurrent.FutureTask < > ( callable ) ; org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.info ( "inserting future task {}" , task ) ; reactor.queueFuture ( task ) ; return task ; }

Target:
protected < T > java.util.concurrent.FutureTask < T > scheduleTask ( java.util.concurrent.Callable < T > callable ) { final java.util.concurrent.FutureTask < T > task = new java.util.concurrent.FutureTask < > ( callable ) ; reactor.queueFuture ( task ) ; return task ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypesCollection = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypesCollection.add ( graphicsDevice.getGraphicsType ( ) ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes graphicsTypes = UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsTypesCollection ) ; org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; setGraphicsType ( translator.translate ( graphicsTypes ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = returnValue.getReturnValue ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypesCollection = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypesCollection.add ( graphicsDevice.getGraphicsType ( ) ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes graphicsTypes = UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsTypesCollection ) ; org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; setGraphicsType ( translator.translate ( graphicsTypes ) ) ; }
Source:
public void copyDetailsFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volumeAdvancedDetails ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails newBrickDetails : volumeAdvancedDetails.getBrickDetails ( ) ) { org.ovirt.engine.core.compat.Guid newBrickId = newBrickDetails.getBrickProperties ( ) . getBrickId ( ) ; if ( newBrickId == null ) { continue ; } for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails brickDetails : getBrickDetails ( ) ) { if ( newBrickId.equals ( brickDetails.getBrickProperties ( ) . getBrickId ( ) ) ) { copyBrickProperties ( newBrickDetails.getBrickProperties ( ) , brickDetails.getBrickProperties ( ) ) ; break ; } } } }

Target:
public void copyDetailsFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volumeAdvancedDetails ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails newBrickDetails : volumeAdvancedDetails.getBrickDetails ( ) ) { org.ovirt.engine.core.compat.Guid newBrickId = newBrickDetails.getBrickProperties ( ) . getBrickId ( ) ; if ( newBrickId != null ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails brickDetails : getBrickDetails ( ) ) { if ( newBrickId.equals ( brickDetails.getBrickProperties ( ) . getBrickId ( ) ) ) { copyBrickProperties ( newBrickDetails.getBrickProperties ( ) , brickDetails.getBrickProperties ( ) ) ; break ; } } } } }
Source:
public java.lang.String customProperties ( java.lang.String predefinedProperties , java.lang.String userDefinedProperties ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( predefinedProperties ) ? "" : predefinedProperties ) ) ; result.append ( ( ( result.length ( ) ) == 0 ? "" : ";" ) ) ; result.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( userDefinedProperties ) ? "" : userDefinedProperties ) ) ; return result.toString ( ) ; }

Target:
public java.lang.String customProperties ( java.lang.String predefinedProperties , java.lang.String userDefinedProperties ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( ( predefinedProperties == null ? "" : predefinedProperties ) ) ; result.append ( ( ( result.length ( ) ) == 0 ? "" : ";" ) ) ; result.append ( ( userDefinedProperties == null ? "" : userDefinedProperties ) ) ; return result.toString ( ) ; }
Source:
public void testExecuteQueryWithoutDirectOnly ( ) { org.ovirt.engine.core.common.VdcObjectType type = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( org.ovirt.engine.core.common.VdcObjectType.values ( ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getVdcObjectType ( ) ) . thenReturn ( type ) ; org.ovirt.engine.core.dao.PermissionDao permissionDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.PermissionDao.class ) ; org.mockito.Mockito.when ( permissionDaoMock.getTreeForEntity ( objectID , type , org.ovirt.engine.core.bll.UNPRIVILEGED_USER_SESSION_ID , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( mockedPermissions ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDaoMock ) ; assertQueryDaoCall ( false ) ; }

Target:
public void testExecuteQueryWithoutDirectOnly ( ) { org.ovirt.engine.core.common.VdcObjectType type = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( org.ovirt.engine.core.common.VdcObjectType.values ( ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getVdcObjectType ( ) ) . thenReturn ( type ) ; org.mockito.Mockito.when ( permissionDaoMock.getTreeForEntity ( objectID , type , org.ovirt.engine.core.bll.UNPRIVILEGED_USER_SESSION_ID , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( mockedPermissions ) ; assertQueryDaoCall ( false ) ; }
Source:
public void testTemplateReplaceProperty ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme1 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 1 ) ; org.junit.Assert.assertTrue ( "Theme 1 should load" , theme1.load ( ) ) ; org.junit.Assert.assertFalse ( "should replace template should be false" , theme1.shouldReplaceWelcomePageSectionTemplate ( ) ) ; }

Target:
public void testTemplateReplaceProperty ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme1 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.Assert.assertTrue ( "Theme 1 should load" , theme1.load ( ) ) ; org.junit.Assert.assertFalse ( "should replace template should be false" , theme1.shouldReplaceWelcomePageSectionTemplate ( ) ) ; }
Source:
public void testDoGet_ExtraAttributes_WithoutUserInfoObject ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.doReturn ( mockApplicationModeObject ) . when ( testServlet ) . getApplicationModeObject ( org.mockito.ArgumentMatchers.nullable ( java.lang.Integer.class ) ) ; org.mockito.Mockito.doReturn ( mockPluginDefinitionsArray ) . when ( testServlet ) . getPluginDefinitionsArray ( org.mockito.ArgumentMatchers.any ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_APPLICATION_MODE , mockApplicationModeObject ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , mockPluginDefinitionsArray ) ; }

Target:
public void testDoGet_ExtraAttributes_WithoutUserInfoObject ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.doReturn ( mockApplicationModeObject ) . when ( testServlet ) . getApplicationModeObject ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( mockPluginDefinitionsArray ) . when ( testServlet ) . getPluginDefinitionsArray ( org.mockito.ArgumentMatchers.any ( ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_APPLICATION_MODE , mockApplicationModeObject ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , mockPluginDefinitionsArray ) ; }
Source:
public static void getStorageDomainMaxNameLength ( 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.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getLoginCommand ( ) ) ) { Login ( ) ; } else if ( command == ( getAboutCommand ( ) ) ) { About ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getLoginCommand ( ) ) ) { Login ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }
Source:
public void validateDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }
Source:
private void createCommand ( ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( ) ; params.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.ActivateStorageDomainCommand ( params , null ) ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; }

Target:
private void createCommand ( ) { cmd.init ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; }
Source:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForDataCenter ( getStoragePoolId ( ) . getValue ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForDataCenter ( getStoragePoolId ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void updateDataProvider ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > items ) { if ( ( currentItems ) == null ) { currentItems = items ; super . updateDataProvider ( items ) ; } else if ( itemsChanged ( items , currentItems ) ) { for ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel itemModel : currentItems ) { itemModel.clearReferences ( ) ; } super . updateDataProvider ( items ) ; } else { org.ovirt.engine.ui.userportal.uicommon.model.AbstractUserPortalListProvider.retainSelectedItems ( ) ; } currentItems = items ; }

Target:
private void clearReferences ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel itemModel : currentItems ) { itemModel.clearReferences ( ) ; } }
Source:
private void updateBond ( ) { org.ovirt.engine.core.common.businessentities.IscsiBond newIscsiBond = createIscsiBond ( ) ; newIscsiBond.setId ( getIscsiBond ( ) . getId ( ) ) ; org.ovirt.engine.core.common.action.EditIscsiBondParameters params = new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( newIscsiBond ) ; startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.EditIscsiBond , params , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.IscsiBondModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.IscsiBondModel ) ( result.getState ( ) ) ) ; model.stopProgress ( ) ; model.cancel ( ) ; } } , this ) ; }

Target:
private void updateBond ( ) { org.ovirt.engine.core.common.businessentities.IscsiBond newIscsiBond = createIscsiBond ( ) ; newIscsiBond.setId ( getIscsiBond ( ) . getId ( ) ) ; org.ovirt.engine.core.common.action.EditIscsiBondParameters params = new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( newIscsiBond ) ; startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.EditIscsiBond , params , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.IscsiBondModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.IscsiBondModel ) ( result.getState ( ) ) ) ; model.stopProgress ( ) ; model.cancel ( ) ; } } , this ) ; }
Source:
private void logException ( java.lang.RuntimeException ex ) { if ( ( ( ex.getMessage ( ) ) == null ) || ( ! ( ex.getMessage ( ) . contains ( "Policy reset" ) ) ) ) { log.error ( "Command '{}' execution failed: {}" , this , ex.getMessage ( ) ) ; log.debug ( "Exception" , ex ) ; } }

Target:
private void logException ( java.lang.RuntimeException ex ) { log.error ( "Command '{}' execution failed: {}" , this , ex.getMessage ( ) ) ; log.debug ( "Exception" , ex ) ; }
Source:
private void allQueriesEmpty ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.powermock.api.mockito.PowerMockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) ; org.powermock.api.mockito.PowerMockito.when ( backendInternal.runInternalQuery ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.SearchParameters.class ) ) ) . thenReturn ( returnValue ) ; org.powermock.api.mockito.PowerMockito.when ( returnValue.getReturnValue ( ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }

Target:
private void allQueriesEmpty ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) ; org.mockito.Mockito.when ( backendInternal.runInternalQuery ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.SearchParameters.class ) ) ) . thenReturn ( returnValue ) ; org.mockito.Mockito.when ( returnValue.getReturnValue ( ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void buildVmLease ( ) { java.util.Map < java.lang.String , java.lang.Object > device = new java.util.HashMap < > ( ) ; device.put ( VdsProperties.Type , VdsProperties.VmLease ) ; device.put ( VdsProperties.Device , VdsProperties.VmLease ) ; device.put ( VdsProperties.DeviceId , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; device.put ( VdsProperties.VmLeaseSdId , vm.getLeaseStorageDomainId ( ) . toString ( ) ) ; device.put ( VdsProperties.VmLeaseId , vm.getId ( ) . toString ( ) ) ; devices.add ( device ) ; }

Target:
public void buildVmLease ( ) { java.util.Map < java.lang.String , java.lang.Object > device = new java.util.HashMap < > ( ) ; device.put ( VdsProperties.Type , VdsProperties.VmLease ) ; device.put ( VdsProperties.Device , VdsProperties.VmLease ) ; device.put ( VdsProperties.DeviceId , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; device.put ( VdsProperties.VmLeaseSdId , vm.getLeaseStorageDomainId ( ) . toString ( ) ) ; device.put ( VdsProperties.VmLeaseId , vm.getId ( ) . toString ( ) ) ; devices.add ( device ) ; }
Source:
public void failsInNotImportedAndNotExists ( ) throws java.lang.Exception { mockGetExistingDomain ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }

Target:
public void failsInNotImportedAndNotExists ( ) throws java.lang.Exception { mockGetExistingDomain ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterByArchitecture ( clusters , selectedTemplate.getClusterArch ( ) ) ; model.setDataCentersAndClusters ( model , dataCenters , filteredClusters , selectedTemplate.getClusterId ( ) ) ; initCdImage ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > filteredClusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterByArchitecture ( clusters , selectedTemplate.getClusterArch ( ) ) ; getModel ( ) . setDataCentersAndClusters ( getModel ( ) , dataCenters , filteredClusters , selectedTemplate.getClusterId ( ) ) ; initCdImage ( ) ; }
Source:
protected void initSoundCard ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSoundcardEnabled ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( returnValue ) ; } } ) , id ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( returnValue ) ; }
Source:
public static void isPoolNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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 ! ( ( java.lang.Boolean ) ( source ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmPoolWithSameNameExists , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void isPoolNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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 ! ( ( java.lang.Boolean ) ( source ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmPoolWithSameNameExists , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void validateVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void validateVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
public void setUp ( ) { vm = createVm ( ) ; validator = new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class , vmNetworkInterfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.VnicProfileDao.class , vnicProfileDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.DiskVmElementDao.class , diskVmElementDao ) ; }

Target:
public void setUp ( ) { vm = createVm ( ) ; validator = new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ; returnValue = runVdsCommand ( VDSCommandType.AddGlusterHook , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( serverHook.getServerId ( ) , entity.getGlusterCommand ( ) , entity.getStage ( ) , entity.getName ( ) , entity.getContent ( ) , entity.getChecksum ( ) , hookEnabled ) ) ; return new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > ( serverHook , returnValue ) ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ; returnValue = runVdsCommand ( VDSCommandType.AddGlusterHook , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( serverHook.getServerId ( ) , entity.getGlusterCommand ( ) , entity.getStage ( ) , entity.getName ( ) , entity.getContent ( ) , entity.getChecksum ( ) , hookEnabled ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( serverHook , returnValue ) ; }
Source:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQoS = ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkQoSModel networkQoSModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkQoSModel ( networkQoS , this , getEntity ( ) ) ; setWindow ( networkQoSModel ) ; networkQoSModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkQoSModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }

Target:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQoS = getSelectedItem ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkQoSModel networkQoSModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkQoSModel ( networkQoS , this , getEntity ( ) ) ; setWindow ( networkQoSModel ) ; networkQoSModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkQoSModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }
Source:
public org.ovirt.engine.api.model.Network lookupNetwork ( org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { for ( org.ovirt.engine.api.model.Network entity : getBackendCollection ( queryType , getQueryParameters ( ) ) ) { if ( ( ( id != null ) && ( id.equals ( entity.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( entity.getname ( ) ) ) ) ) { return entity ; } } return null ; }

Target:
public org.ovirt.engine.api.model.Network lookupNetwork ( org.ovirt.engine.core.compat.Guid id , java.lang.String name ) { for ( org.ovirt.engine.api.model.Network entity : getBackendCollection ( queryType , getQueryParameters ( ) ) ) { if ( ( ( id != null ) && ( id.equals ( entity.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( entity.getName ( ) ) ) ) ) { return entity ; } } return null ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; modelProvider.onSubTabSelected ( ) ; if ( ( org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) ) != null ) { org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; modelProvider.onSubTabSelected ( ) ; if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } }
Source:
private void handleActionWithKey ( java.lang.String action , java.lang.String key ) { engineConfigMap.setConfigAction ( org.ovirt.engine.core.config.validation.ConfigActionType.getActionType ( action ) ) ; if ( ( action.equals ( "--get" ) ) || ( action.equals ( "--help" ) ) ) { engineConfigMap.setKey ( key ) ; } else { org.ovirt.engine.core.config.EngineConfigCLIParser.log.debug ( "parseAction error: first argument is illegal." ) ; throw new java.lang.IllegalArgumentException ( ( ( ( ( "Action verb must come first, and '" + action ) + '=' ) + key ) + "\' is not an action.\nPlease tell me what to do: list? get? set? get-all?" ) ) ; } }

Target:
private void handleActionWithKey ( java.lang.String action , java.lang.String key ) { engineConfigMap.setConfigAction ( org.ovirt.engine.core.config.validation.ConfigActionType.getActionType ( action ) ) ; if ( ( action.equals ( "--get" ) ) || ( action.equals ( "--help" ) ) ) { engineConfigMap.setKey ( key ) ; } else { throw new java.lang.IllegalArgumentException ( ( ( ( ( "Action verb must come first, and '" + action ) + '=' ) + key ) + "\' is not an action.\nPlease tell me what to do: list? get? set? get-all?" ) ) ; } }
Source:
private static java.util.List < org.ovirt.engine.core.compat.Guid > mockStorageGuidList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains ) { java.util.List < org.ovirt.engine.core.compat.Guid > storageGuidList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : storageDomains ) { storageGuidList.add ( storageDomain.getId ( ) ) ; } return storageGuidList ; }

Target:
private static java.util.List < org.ovirt.engine.core.compat.Guid > mockStorageGuidList ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { java.util.List < org.ovirt.engine.core.compat.Guid > storageGuidList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { storageGuidList.add ( storageDomain.getId ( ) ) ; } return storageGuidList ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( array [ 0 ] ) ) ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.updataMaxVmsInPool ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = this ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.updataMaxVmsInPool ( ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getCurrentUser ( ) . getUserId ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }
Source:
public void failWhenProxyHostNotAvailable ( ) { org.mockito.Mockito.when ( proxyLocator.isProxyHostAvailable ( ) ) . thenReturn ( false ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isProxyHostAvailable ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , messages ) ; org.junit.Assert.assertFalse ( result ) ; org.junit.Assert.assertEquals ( messages.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , "VDS_NO_VDS_PROXY_FOUND" ) ; }

Target:
public void failWhenProxyHostNotAvailable ( ) { org.mockito.Mockito.when ( proxyLocator.isProxyHostAvailable ( ) ) . thenReturn ( false ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isProxyHostAvailable ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , messages ) ; org.junit.Assert.assertFalse ( result ) ; org.junit.Assert.assertEquals ( 1 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( "VDS_NO_VDS_PROXY_FOUND" , messages.get ( 0 ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult Validate ( java.lang.String value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; if ( ( value == null ) || ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( value ) ) ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . quotaMustBeSelectedInvalidReason ( ) ) ; } return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; if ( ( value == null ) || ( ( value instanceof java.lang.String ) && ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( value ) ) ) ) ) ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . quotaMustBeSelectedInvalidReason ( ) ) ; } return result ; }
Source:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getstorage_pool_id ( ) , Guid.Empty , true , true , false , false , false , false , true , true , getImagesList ( ) ) ; }

Target:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , false , false , true , true , getImagesList ( ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.isUserCanBeAuthenticated ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; if ( log.isDebugEnabled ( ) ) { log.debugFormat ( "LoginAdminUser: No admin role found for user - login failed." ) ; } } else { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.attachUserToSession ( ) ; } } return autheticated ; }

Target:
protected boolean canDoAction ( ) { boolean autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.isUserCanBeAuthenticated ( ) ; if ( autheticated ) { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.getCurrentUser ( ) . isAdmin ( ) ; if ( ! autheticated ) { addCanDoActionMessage ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } else { autheticated = org.ovirt.engine.core.bll.LoginAdminUserCommand.attachUserToSession ( ) ; } } return autheticated ; }
Source:
public void testIsCrossReference ( ) { org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter comp = new org.ovirt.engine.core.searchbackend.SearchObjectAutoCompleter ( true ) ; org.junit.Assert.assertTrue ( "EVENTS" , comp.isCrossReferece ( "EVENTS" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Cross" , comp.isCrossReferece ( "fsfsdf" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Object" , comp.isCrossReferece ( "EVENTS" , "fsfds" ) ) ; org.junit.Assert.assertFalse ( "Null Object" , comp.isCrossReferece ( "EVENTS" , null ) ) ; org.junit.Assert.assertFalse ( "Null text" , comp.isCrossReferece ( null , "TEMPLATES" ) ) ; }

Target:
public void testIsCrossReference ( ) { org.junit.Assert.assertTrue ( "EVENTS" , comp.isCrossReferece ( "EVENTS" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Cross" , comp.isCrossReferece ( "fsfsdf" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Object" , comp.isCrossReferece ( "EVENTS" , "fsfds" ) ) ; org.junit.Assert.assertFalse ( "Null Object" , comp.isCrossReferece ( "EVENTS" , null ) ) ; org.junit.Assert.assertFalse ( "Null text" , comp.isCrossReferece ( null , "TEMPLATES" ) ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel object ) { driver.edit ( object ) ; cpuPanel.setVisible ( object.isCpuPluggable ( ) ) ; com.google.gwt.safehtml.shared.SafeHtmlBuilder changedFieldsBuilder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( java.lang.String field : object.getChangedFields ( ) ) { java.lang.String escapedField = com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( field ) ; changedFieldsBuilder.append ( listItem ( escapedField , templates ) ) ; } changedFields.setHTML ( changedFieldsBuilder.toSafeHtml ( ) ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel object ) { driver.edit ( object ) ; cpuPanel.setVisible ( object.isCpuPluggable ( ) ) ; com.google.gwt.safehtml.shared.SafeHtmlBuilder changedFieldsBuilder = new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) ; for ( java.lang.String field : object.getChangedFields ( ) ) { java.lang.String escapedField = com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( field ) ; changedFieldsBuilder.append ( listItem ( escapedField ) ) ; } changedFields.setHTML ( changedFieldsBuilder.toSafeHtml ( ) ) ; }
Source:
private void cleanConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection , org.ovirt.engine.core.compat.Guid hostId ) { if ( ( ( connection.getId ( ) ) != null ) && ( ! ( connection.getId ( ) . equals ( "" ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveStorageServerConnection , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) , null , this ) ; } }

Target:
private void cleanConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection , org.ovirt.engine.core.compat.Guid hostId ) { if ( ( ( connection.getId ( ) ) != null ) && ( ! ( connection.getId ( ) . equals ( "" ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveStorageServerConnection , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId , false ) , null , this ) ; } }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; setUpGetStorageDomainsQueryExpectations ( 1 ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
public static void removeDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed to remove disk image and related entities from db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }

Target:
public void removeDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.error ( "Failed to remove disk image and related entities from db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }