auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateOldImageActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.error ( "Can't find image to update to active '{}', snapshot type '{}', original image id '{}'" , active , snapshotType , org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.DiskImage oldImage = org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setActive ( active ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }

Target:
protected void updateOldImageActive ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , boolean active ) { org.ovirt.engine.core.compat.Guid oldImageId = findImageForSameDrive ( snapshotType ) ; if ( oldImageId == null ) { log.error ( "Can't find image to update to active '{}', snapshot type '{}', original image id '{}'" , active , snapshotType , org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageId ( ) ) ; return ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage oldImage = org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( oldImageId ) ; oldImage.setActive ( active ) ; org.ovirt.engine.core.bll.TryBackToSnapshotCommand.getImageDao ( ) . update ( oldImage.getImage ( ) ) ; }
Source:
private int calcHostScore ( float maxMemoryOfVdsInCluster , org.ovirt.engine.core.common.businessentities.VDS vds ) { int score = java.lang.Math.round ( ( ( ( ( vds.getMaxSchedulingMemory ( ) ) - 1 ) * ( ( MaxSchedulerWeight ) - 1 ) ) / ( maxMemoryOfVdsInCluster - 1 ) ) ) ; return ( MaxSchedulerWeight ) - score ; }

Target:
private int calcHostScore ( float maxMemoryOfVdsInCluster , org.ovirt.engine.core.common.businessentities.VDS vds ) { int score = java.lang.Math.round ( ( ( ( ( vds.getMaxSchedulingMemory ( ) ) - 1 ) * ( ( getMaxSchedulerWeight ( ) ) - 1 ) ) / ( maxMemoryOfVdsInCluster - 1 ) ) ) ; return ( getMaxSchedulerWeight ( ) ) - score ; }
Source:
protected void executeQueryCommand ( ) { if ( ! ( isAdminUser ( ) ) ) { setReturnValue ( org.ovirt.engine.core.bll.GetAllRolesQuery.getDbFacade ( ) . getRoleDao ( ) . getAllNonAdminRoles ( ) ) ; } else { setReturnValue ( org.ovirt.engine.core.bll.GetAllRolesQuery.getDbFacade ( ) . getRoleDao ( ) . getAll ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { if ( ! ( isAdminUser ( ) ) ) { setReturnValue ( roleDao.getAllNonAdminRoles ( ) ) ; } else { setReturnValue ( roleDao.getAll ( ) ) ; } }
Source:
public static void GetVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetDiskMaxSize ( 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 ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void send ( byte [ ] message ) { outbox.addFirst ( java.nio.ByteBuffer.wrap ( message ) ) ; org.ovirt.vdsm.jsonrpc.client.reactors.stomp.SSLStompClient.LOG.info ( ( "Message sent: " + ( new java.lang.String ( message , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.UTF8 ) ) ) ) ; final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = this ; scheduleTask ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { client.updateInterestedOps ( ) ; return null ; } } ) ; }

Target:
protected org.ovirt.vdsm.jsonrpc.client.utils.OneTimeCallback getPostConnectCallback ( ) { this . callback.resetExecution ( ) ; setWaitForConnect ( ) ; return this . callback ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "EntityId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private static java.lang.String getMessageToLog ( java.lang.String loggerString , org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { java.lang.String logMessage ; if ( loggerString.isEmpty ( ) ) { logMessage = auditLog.toStringForLogging ( ) ; } else { logMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.transform ( loggerString , auditLog.getmessage ( ) ) ; } return logMessage ; }

Target:
private static java.lang.String getMessageToLog ( java.lang.String loggerString , org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { if ( loggerString.isEmpty ( ) ) { return auditLog.toStringForLogging ( ) ; } else { return java.text.MessageFormat.format ( loggerString , auditLog.getMessage ( ) ) ; } }
Source:
private void mockCommandCall ( org.ovirt.engine.core.common.action.VdcActionType actionType , boolean withContext ) { if ( withContext ) { org.mockito.Mockito.doReturn ( successfulReturnValue ( ) ) . when ( backend ) . runInternalAction ( org.mockito.Matchers.eq ( actionType ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) ) ; } else { org.mockito.Mockito.doReturn ( successfulReturnValue ( ) ) . when ( backend ) . runInternalAction ( org.mockito.Matchers.eq ( actionType ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ) ; } }

Target:
private void mockCommandCall ( org.ovirt.engine.core.common.action.VdcActionType actionType , boolean withContext ) { if ( withContext ) { org.mockito.Mockito.doReturn ( successfulReturnValue ( ) ) . when ( backend ) . runInternalAction ( org.mockito.ArgumentMatchers.eq ( actionType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) ) ; } else { org.mockito.Mockito.doReturn ( successfulReturnValue ( ) ) . when ( backend ) . runInternalAction ( org.mockito.ArgumentMatchers.eq ( actionType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ) ; } }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Inventory populateInventoryCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory = lookupInventory ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; if ( enableBackgroundCacheUpdate ) { org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.inventoryCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY , inventory ) ; } else { org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.inventoryCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY , inventory , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; } org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard inventoy cache updated in {}ms" , ( endTime - startTime ) ) ; return inventory ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard getDashboardFromCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory ; synchronized ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_LOCK ) { dashboard = dashboardCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY ) ; if ( dashboard == null ) { dashboard = populateUtilizationCache ( ) ; } inventory = inventoryCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY ) ; if ( inventory == null ) { inventory = populateInventoryCache ( ) ; } } dashboard.setInventory ( inventory ) ; return dashboard ; }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Cdrom model = new org.ovirt.engine.api.model.Cdrom ( ) ; model.setName ( NAMES [ 0 ] ) ; model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "add" , "file.id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Cdrom model = new org.ovirt.engine.api.model.Cdrom ( ) ; model.setName ( NAMES [ 0 ] ) ; model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "add" , "file.id" ) ; } }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( 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.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public 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 ) ; }

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:
private org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > parseDisplayProtocol ( java.lang.String displayProtocol ) { org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > pairs = null ; java.lang.String [ ] displayProtocolSplit = displayProtocol.split ( "/" ) ; if ( ( displayProtocolSplit.length ) == 2 ) { return new org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > ( displayProtocolSplit [ 0 ] . trim ( ) , displayProtocolSplit [ 1 ] . trim ( ) ) ; } return pairs ; }

Target:
private org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > parseGraphicsAndDisplayPair ( java.lang.String displayAndGraphicsString ) { java.util.ArrayList < java.lang.String > splitted = trimElements ( displayAndGraphicsString.split ( "/" ) ) ; return ( splitted.size ( ) ) == 2 ? new org.ovirt.engine.core.common.utils.Pair ( splitted.get ( 0 ) , splitted.get ( 1 ) ) : null ; }
Source:
public void SaveDefaultValues ( ) { if ( ( getSelectionAlgorithm ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.EvenlyDistribute ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.highLimitEvenlyDistributed = getOverCommitHighLevel ( ) ; } else if ( ( getSelectionAlgorithm ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.PowerSave ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.lowLimitPowerSaving = getOverCommitLowLevel ( ) ; org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.highLimitPowerSaving = getOverCommitHighLevel ( ) ; } }

Target:
public void saveDefaultValues ( ) { if ( ( getSelectionAlgorithm ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.EvenlyDistribute ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.highLimitEvenlyDistributed = getOverCommitHighLevel ( ) ; } else if ( ( getSelectionAlgorithm ( ) ) == ( org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.PowerSave ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.lowLimitPowerSaving = getOverCommitLowLevel ( ) ; org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel.highLimitPowerSaving = getOverCommitHighLevel ( ) ; } }
Source:
public static boolean isSingular ( java.lang.String candidate ) { return ! ( org.ovirt.engine.sdk.codegen.utils.StringUtils.isPlural ( candidate ) ) ; }

Target:
public static java.lang.String concatenateValues ( java.util.Map < java.lang.String , java.lang.String > map ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < > ( map.keySet ( ) ) ; java.util.Collections.sort ( keys ) ; java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; keys.forEach ( ( key ) -> buffer.append ( map.get ( key ) ) ) ; return buffer.toString ( ) ; }
Source:
private static org.ovirt.engine.api.model.Options parseOptions ( java.lang.String str , java.util.Map < java.lang.String , java.lang.String > types , boolean ignoreValues ) { org.ovirt.engine.api.model.Options ret = new org.ovirt.engine.api.model.Options ( ) ; for ( java.lang.String option : str.split ( "," , ( - 1 ) ) ) { if ( ! ( option.isEmpty ( ) ) ) { ret.getOptions ( ) . add ( org.ovirt.engine.api.restapi.util.FencingOptionsParser.parseOption ( option , types , ignoreValues ) ) ; } } return ret ; }

Target:
private static org.ovirt.engine.api.model.Options parseOptions ( java.lang.String str , java.util.Map < java.lang.String , java.lang.String > types , boolean ignoreValues ) { org.ovirt.engine.api.model.Options ret = new org.ovirt.engine.api.model.Options ( ) ; for ( java.lang.String option : str.split ( "," , ( - 1 ) ) ) { if ( ! ( option.isEmpty ( ) ) ) { ret.getOptions ( ) . add ( org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseOption ( option , types , ignoreValues ) ) ; } } return ret ; }
Source:
public void externalNetworkVlanValid ( ) { org.mockito.Mockito.when ( network.getVlanId ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; org.mockito.Mockito.when ( network.getLabel ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertThat ( validator.externalNetworkVlanValid ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void externalNetworkVlanValid ( ) { org.mockito.Mockito.when ( network.getVlanId ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; org.mockito.Mockito.when ( network.getLabel ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.externalNetworkVlanValid ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void onBootstrap ( ) { user.setLogoutHandler ( this ) ; initUiCommon ( ) ; initFrontend ( ) ; initLoginModel ( ) ; org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData = org.ovirt.engine.ui.common.auth.AutoLoginData.instance ( ) ; if ( autoLoginData != null ) { handleAutoLogin ( autoLoginData ) ; } }

Target:
public void onBootstrap ( ) { user.setLogoutHandler ( this ) ; initUiCommon ( ) ; initFrontend ( ) ; initLoginModel ( ) ; org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData = org.ovirt.engine.ui.common.auth.AutoLoginData.instance ( ) ; if ( autoLoginData != null ) { handleAutoLogin ( autoLoginData ) ; } org.ovirt.engine.ui.common.restapi.EngineSessionTimeoutData engineSessionTimeoutData = org.ovirt.engine.ui.common.restapi.EngineSessionTimeoutData.instance ( ) ; if ( engineSessionTimeoutData != null ) { restApiSessionManager.setSessionTimeout ( engineSessionTimeoutData.getSessionTimeout ( ) ) ; restApiSessionManager.setHardLimit ( engineSessionTimeoutData.getSessionHardLimit ( ) ) ; } }
Source:
protected void SyncSearch ( ) { org.ovirt.engine.core.common.queries.SearchParameters tempVar = new org.ovirt.engine.core.common.queries.SearchParameters ( getSearchString ( ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; tempVar.setRefresh ( getIsQueryFirstTime ( ) ) ; super . SyncSearch ( VdcQueryType.Search , tempVar ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { if ( model.equals ( getViewFilterType ( ) ) ) { this . setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; } }
Source:
private org.ovirt.engine.core.compat.Guid getNonPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Down ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachNonPrestartedVmToUser ( map.getvm_guid ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private org.ovirt.engine.core.compat.Guid getNonPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Down ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( ( ! ( lockedVms.contains ( map.getvm_guid ( ) ) ) ) && ( canAttachNonPrestartedVmToUser ( map.getvm_guid ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getNic ( false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) ; try { resource.update ( getNic ( false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void commandSucceeds ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeGeoRepSessionCommandTest.SUPPORTED_VERSION ) . when ( cluster ) . getCompatibilityVersion ( ) ; org.mockito.Mockito.doReturn ( volume ) . when ( command ) . getSlaveVolume ( ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getSlaveHost ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void commandSucceeds ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeGeoRepSessionCommandTest.SUPPORTED_VERSION ) . when ( cluster ) . getCompatibilityVersion ( ) ; org.mockito.Mockito.doReturn ( volume ) . when ( command ) . getSlaveVolume ( ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getSlaveHost ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validate ( ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( result.getState ( ) ) ; cancel ( ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , this ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.setVmTicket ( vmId , otp64 , sec ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extend_image_ticket ( ticketId , timeout ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void addEntriesToNfsCummulativeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStats ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > fopStatsEntities = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > ( ) ; for ( int i = 0 ; i < ( fopStats.size ( ) ) ; i ++ ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStatEntity = new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > ( fopStats.get ( i ) ) ; fopStatsEntities.add ( fopStatEntity ) ; } getNfsServerProfileStats ( ) . setItems ( fopStatsEntities ) ; }

Target:
private void populateCummulativeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStats , org.ovirt.engine.ui.uicommonweb.models.ListModel profileStats ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > fopStatsEntities = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > ( ) ; for ( int i = 0 ; i < ( fopStats.size ( ) ) ; i ++ ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStatEntity = new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > ( fopStats.get ( i ) ) ; fopStatsEntities.add ( fopStatEntity ) ; } profileStats.setItems ( fopStatsEntities ) ; }
Source:
void initialize ( ) { try { java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPool > macPools = macPoolDao.getAll ( ) ; for ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool : macPools ) { initializeMacPool ( macPool ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.info ( "Successfully initialized" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.error ( "Error initializing: {}" , e.getMessage ( ) ) ; throw e ; } }

Target:
void initialize ( ) { try { java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPool > macPools = macPoolDao.getAll ( ) ; for ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool : macPools ) { createPoolInternal ( macPool , true ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.info ( "Successfully initialized" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.error ( "Error initializing: {}" , e.getMessage ( ) ) ; throw e ; } }
Source:
public org.ovirt.engine.ui.uicommonweb.models.providers.ProxyHostPropertiesModel getProxyHostPropertiesModel ( ) { if ( isTypeKVM ( ) ) { return getKvmPropertiesModel ( ) ; } else if ( isTypeVmware ( ) ) { return getVmwarePropertiesModel ( ) ; } else { return new org.ovirt.engine.ui.uicommonweb.models.providers.ProxyHostPropertiesModel ( ) { } ; } }

Target:
public org.ovirt.engine.ui.uicommonweb.models.providers.ProxyHostPropertiesModel getProxyHostPropertiesModel ( ) { if ( isTypeXEN ( ) ) { return getXenPropertiesModel ( ) ; } else if ( isTypeKVM ( ) ) { return getKvmPropertiesModel ( ) ; } else if ( isTypeVmware ( ) ) { return getVmwarePropertiesModel ( ) ; } else { return new org.ovirt.engine.ui.uicommonweb.models.providers.ProxyHostPropertiesModel ( ) { } ; } }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.warnFormat ( logMessage ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( mCurrentVdsId ) ; logable.setStorageDomainId ( masterDomainId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC ) ; return org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . masterDomainNotOperational ( masterDomainId , storagePoolId , false , true ) ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.warn ( logMessage ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( mCurrentVdsId ) ; logable.setStorageDomainId ( masterDomainId ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC ) ; return org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . masterDomainNotOperational ( masterDomainId , storagePoolId , false , true ) ; }
Source:
public void refresh ( ) throws sun.security.krb5.KrbException { if ( ! ( isKerberosAuth ( ) ) ) { return ; } org.ovirt.engine.core.bll.adbroker.KerberosManager.log.info ( "Refreshing kerberos configuration" ) ; sun.security.krb5.Config.refresh ( ) ; }

Target:
public static org.ovirt.engine.core.bll.adbroker.KerberosManager getInstance ( ) { if ( ( org.ovirt.engine.core.bll.adbroker.KerberosManager.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.adbroker.KerberosManager.class ) { if ( ( org.ovirt.engine.core.bll.adbroker.KerberosManager.instance ) == null ) { org.ovirt.engine.core.bll.adbroker.KerberosManager.instance = new org.ovirt.engine.core.bll.adbroker.KerberosManager ( ) ; } } } return org.ovirt.engine.core.bll.adbroker.KerberosManager.instance ; }
Source:
public void testToString ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > nameServers = java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "192.168.1.1" ) , new org.ovirt.engine.core.common.businessentities.network.NameServer ( "192.168.1.2" ) ) ; org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration dnsResolverConfiguration = new org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration ( ) ; dnsResolverConfiguration.setNameServers ( nameServers ) ; org.junit.Assert.assertThat ( dnsResolverConfiguration.toString ( ) , org.hamcrest.CoreMatchers.is ( ( "DnsResolverConfiguration:{id='null', nameServers='[NameServer:{address='192.168.1.1'}, " + "NameServer:{address='192.168.1.2'}]'}" ) ) ) ; }

Target:
public void testToString ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > nameServers = java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "192.168.1.1" ) , new org.ovirt.engine.core.common.businessentities.network.NameServer ( "192.168.1.2" ) ) ; org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration dnsResolverConfiguration = new org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration ( ) ; dnsResolverConfiguration.setNameServers ( nameServers ) ; org.hamcrest.MatcherAssert.assertThat ( dnsResolverConfiguration.toString ( ) , org.hamcrest.CoreMatchers.is ( ( "DnsResolverConfiguration:{id='null', nameServers='[NameServer:{address='192.168.1.1'}, " + "NameServer:{address='192.168.1.2'}]'}" ) ) ) ; }
Source:
private boolean validateReplacementElementCount ( java.util.Collection < java.lang.String > replacements , java.lang.String separator , int numOfElementsToShow ) { java.lang.String replacement = replacements.iterator ( ) . next ( ) ; java.lang.String [ ] values = replacement.split ( separator ) ; int numOfElementsFound = 0 ; for ( int i = 0 ; i < ( values.length ) ; i ++ ) { if ( values [ i ] . contains ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME ) ) { numOfElementsFound ++ ; } } return numOfElementsFound == numOfElementsToShow ; }

Target:
private boolean validateReplacementElementCount ( java.util.Collection < java.lang.String > replacements , java.lang.String separator , int numOfElementsToShow ) { java.lang.String replacement = replacements.iterator ( ) . next ( ) ; java.lang.String [ ] values = replacement.split ( separator ) ; int numOfElementsFound = ( ( int ) ( java.util.Arrays.stream ( values ) . filter ( ( v ) -> v.contains ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME ) ) . count ( ) ) ) ; return numOfElementsFound == numOfElementsToShow ; }
Source:
public static boolean isBondVlan ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaces ) { if ( ( java.lang.Boolean.TRUE.equals ( i.getBonded ( ) ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( iface.getName ( ) , i.getName ( ) ) ) ) { return true ; } } } return false ; }

Target:
public static boolean isBondVlan ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaces ) { if ( ( java.lang.Boolean.TRUE.equals ( i.getBonded ( ) ) ) && ( i.getName ( ) . equals ( iface.getBaseInterface ( ) ) ) ) { return true ; } } } return false ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) ; org.ovirt.engine.core.common.businessentities.Disk disk = diskModel.getDisk ( ) ; boolean lunIscsiLimitation = ( ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) ; boolean ideLimitation = ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ; return ( ! lunIscsiLimitation ) && ( ! ideLimitation ) ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) ; org.ovirt.engine.core.common.businessentities.Disk disk = diskModel.getDisk ( ) ; boolean isScsiPassthrough = disk.isScsiPassthrough ( ) ; boolean ideLimitation = ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ; return ( ! isScsiPassthrough ) && ( ! ideLimitation ) ; }
Source:
public static org.ovirt.engine.api.model.Image map ( org.ovirt.engine.core.common.businessentities.RepoImage entity , org.ovirt.engine.api.model.Image template ) { org.ovirt.engine.api.model.Image model = ( template != null ) ? template : new org.ovirt.engine.api.model.Image ( ) ; model.setId ( entity.getRepoImageId ( ) ) ; model.setName ( entity.getRepoImageName ( ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Image map ( org.ovirt.engine.core.common.businessentities.storage.RepoImage entity , org.ovirt.engine.api.model.Image template ) { org.ovirt.engine.api.model.Image model = ( template != null ) ? template : new org.ovirt.engine.api.model.Image ( ) ; model.setId ( entity.getRepoImageId ( ) ) ; model.setName ( entity.getRepoImageName ( ) ) ; return model ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( cModel == null ) { return ; } else { cModel.stopProgress ( ) ; if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cModel.setMessage ( result.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; } else { setWindow ( null ) ; } } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( cModel == null ) { return ; } else { cModel.stopProgress ( ) ; if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cModel.setActionConfirmationMessage ( result.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; } else { setWindow ( null ) ; } } }
Source:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( getQuery ( ) ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }

Target:
private void setupMock ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setSucceeded ( true ) ; returnValue.setReturnValue ( expected ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( getQuery ( ) ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeOptionsInfo ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( getQuery ( ) ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( CLUSTER_ID ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; getParameters ( ) . getLibvirtSecret ( ) . setCreationDate ( new java.util.Date ( ) ) ; getLibvirtSecretDAO ( ) . save ( getParameters ( ) . getLibvirtSecret ( ) ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { super . executeCommand ( ) ; getParameters ( ) . getLibvirtSecret ( ) . setCreationDate ( new java.util.Date ( ) ) ; getLibvirtSecretDAO ( ) . save ( getParameters ( ) . getLibvirtSecret ( ) ) ; registerLibvirtSecret ( ) ; setSucceeded ( true ) ; }
Source:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , null , disks , null ) , true , null ) ; }

Target:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , null , disks , null ) , true , null ) ; }
Source:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object networkQoS : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.action.NetworkQoSParametersBase parameter = new org.ovirt.engine.core.common.action.NetworkQoSParametersBase ( ) ; parameter.setNetworkQoS ( ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( networkQoS ) ) ) ; parameters.add ( parameter ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveNetworkQoS , parameters ) ; cancel ( ) ; }

Target:
public void onRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object networkQoS : sourceListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.action.NetworkQoSParametersBase parameter = new org.ovirt.engine.core.common.action.NetworkQoSParametersBase ( ) ; parameter.setNetworkQoS ( ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( networkQoS ) ) ) ; parameters.add ( parameter ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveNetworkQoS , parameters ) ; cancel ( ) ; }
Source:
public boolean Validate ( ) { getPath ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }

Target:
public boolean Validate ( ) { getPath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }
Source:
void localize ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { nameEditor.setLabel ( constants.makeTemplatePopupNameLabel ( ) ) ; descriptionEditor.setLabel ( constants.makeTemplatePopupDescriptionLabel ( ) ) ; clusterEditor.setLabel ( constants.makeTemplateClusterLabel ( ) ) ; quotaEditor.setLabel ( constants.makeTemplateQuotaLabel ( ) ) ; isTemplatePublicEditor.setLabel ( constants.makeTemplateIsTemplatePublicEditorLabel ( ) ) ; disksAllocationLabel.setText ( constants.disksAllocation ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { nameEditor.setLabel ( constants.makeTemplatePopupNameLabel ( ) ) ; descriptionEditor.setLabel ( constants.makeTemplatePopupDescriptionLabel ( ) ) ; clusterEditor.setLabel ( constants.makeTemplateClusterLabel ( ) ) ; quotaEditor.setLabel ( constants.makeTemplateQuotaLabel ( ) ) ; isTemplatePublicEditor.setLabel ( constants.makeTemplateIsTemplatePublicEditorLabel ( ) ) ; copyVmPermissions.setLabel ( constants.copyVmPermissions ( ) ) ; disksAllocationLabel.setText ( constants.disksAllocation ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; setItems ( disks ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = result.getReturnValue ( ) ; if ( vm == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters queryParameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ; queryParameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksPartialDataByVmId , queryParameters , new org.ovirt.engine.ui.uicommonweb.models.userportal.SetSortedItemsAsyncQuery ( new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ) ; } }
Source:
public void getVmTemplateWithVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; b.setVmTemplate ( null ) ; b.setVmTemplateId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setvmt_guid ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VmTemplate t = b.getVmTemplate ( ) ; org.junit.Assert.assertNotNull ( t ) ; }

Target:
public void getVmTemplateWithVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; b.setVmTemplate ( null ) ; b.setVmTemplateId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVmtGuid ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VmTemplate t = b.getVmTemplate ( ) ; org.junit.Assert.assertNotNull ( t ) ; }