auphong2707/dl4se-code-review-dataset huggingface dataset:
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.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
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.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.SetDataCenter ( model , list ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
private void setDefaultConsoleMode ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ISpicePlugin pluginSpice = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpicePlugin ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpicePlugin.class ) ) ) ; setspice ( ( pluginSpice.detectBrowserPlugin ( ) ? pluginSpice : ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpice ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceNative.class ) ) ) ) ) ; }

Target:
private void setDefaultConsoleMode ( ) { setspice ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpice ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpiceNative.class ) ) ) ) ; }
Source:
private void mockFencedHost ( ) { fencedHost = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID ) . when ( fencedHost ) . getId ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) . when ( fencedHost ) . getVdsGroupId ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) . when ( fencedHost ) . getStoragePoolId ( ) ; org.mockito.Mockito.doReturn ( "fencedHost" ) . when ( fencedHost ) . getHostName ( ) ; org.mockito.Mockito.doReturn ( java.util.Arrays.asList ( createFenceAgent ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID , "ipmilan" ) ) ) . when ( fencedHost ) . getFenceAgents ( ) ; }

Target:
private void mockFencedHost ( ) { fencedHost = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( fencedHost.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID ) ; org.mockito.Mockito.when ( fencedHost.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getHostName ( ) ) . thenReturn ( "fencedHost" ) ; org.mockito.Mockito.when ( fencedHost.getFenceAgents ( ) ) . thenReturn ( java.util.Arrays.asList ( createFenceAgent ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID , "ipmilan" ) ) ) ; }
Source:
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 ; }

Target:
private org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > parseGraphicsAndDisplayPair ( java.lang.String displayAndGraphicsString ) { java.util.List < 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:
private org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.CallCreator createCallForRead ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < ? > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { return new org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.CallCreator ( ) { @ java.lang.Override public org.springframework.jdbc.core.simple.SimpleJdbcCall createCall ( ) { org.springframework.jdbc.core.simple.SimpleJdbcCall call = ( ( org.springframework.jdbc.core.simple.SimpleJdbcCall ) ( dialect.createJdbcCallForQuery ( jdbcTemplate ) . withProcedureName ( procedureName ) ) ) ; call.returningResultSet ( org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.RETURN_VALUE_PARAMETER , mapper ) ; call.getInParameterNames ( ) . addAll ( org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils.extractCaseInsensitiveParameterNames ( parameterSource ) . keySet ( ) ) ; return call ; } } ; }

Target:
private org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.CallCreator createCallForRead ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < ? > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { return ( ) -> { org.springframework.jdbc.core.simple.SimpleJdbcCall call = ( ( org.springframework.jdbc.core.simple.SimpleJdbcCall ) ( dialect.createJdbcCallForQuery ( jdbcTemplate ) . withProcedureName ( procedureName ) ) ) ; call.returningResultSet ( org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.RETURN_VALUE_PARAMETER , mapper ) ; call.getInParameterNames ( ) . addAll ( org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils.extractCaseInsensitiveParameterNames ( parameterSource ) . keySet ( ) ) ; return call ; } ; }
Source:
private void mockStorageDomainDAOGet ( final int domainSpaceGB ) { org.powermock.api.mockito.PowerMockito.doAnswer ( new org.mockito.stubbing.Answer < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.storage_domains answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { org.ovirt.engine.core.common.businessentities.storage_domains result = createStorageDomain ( domainSpaceGB ) ; result.setId ( ( ( org.ovirt.engine.core.compat.Guid ) ( invocation.getArguments ( ) [ 0 ] ) ) ) ; return result ; } } ) . when ( sdDAO ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
private void mockStorageDomainDAOGet ( final int domainSpaceGB ) { org.mockito.Mockito.doAnswer ( new org.mockito.stubbing.Answer < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.storage_domains answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { org.ovirt.engine.core.common.businessentities.storage_domains result = createStorageDomain ( domainSpaceGB ) ; result.setId ( ( ( org.ovirt.engine.core.compat.Guid ) ( invocation.getArguments ( ) [ 0 ] ) ) ) ; return result ; } } ) . when ( sdDAO ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
private void setupVmTemplateDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > expectedVmTemplate = java.util.Collections.singletonList ( vmTemplate ) ; org.ovirt.engine.core.dao.VmTemplateDao vmTemplateDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmTemplateDao.class ) ; org.mockito.Mockito.when ( vmTemplateDao.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmTemplate ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmTemplateDao ( ) ) . thenReturn ( vmTemplateDao ) ; }

Target:
private void setupVmTemplateDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > expectedVmTemplate = java.util.Collections.singletonList ( vmTemplate ) ; org.mockito.Mockito.when ( vmTemplateDao.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVmTemplate ) ; }
Source:
public static boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }

Target:
public boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }
Source:
public java.util.concurrent.Future < java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > > batchCall ( java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest > requests ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.BatchCall call = new org.ovirt.vdsm.jsonrpc.client.internal.BatchCall ( requests ) ; for ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request : requests ) { this . tracker.registerCall ( request , call ) ; } this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( requests ) ) ; retryBatchCall ( requests , call ) ; return call ; }

Target:
public java.util.concurrent.Future < java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > > batchCall ( java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest > requests ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.BatchCall call = new org.ovirt.vdsm.jsonrpc.client.internal.BatchCall ( requests ) ; for ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request : requests ) { this . tracker.registerCall ( request , call ) ; } try { this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( requests ) ) ; } finally { retryBatchCall ( requests , call ) ; } return call ; }
Source:
private java.lang.String getInstalledVdsIdIfExists ( org.ovirt.engine.core.utils.ssh.SSHClient client ) { try { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 256 ) ; client.executeCommand ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.GetVdsmIdByVdsmToolCommand ) , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } catch ( java.lang.Exception e ) { log.warnFormat ( "Failed to initiate vdsm-id request on host" , e ) ; return null ; } }

Target:
private java.lang.String getInstalledVdsIdIfExists ( org.ovirt.engine.core.utils.ssh.SSHClient client ) { try { java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 256 ) ; client.executeCommand ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.GetVdsmIdByVdsmToolCommand ) , null , out , null ) ; return new java.lang.String ( out.toByteArray ( ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } catch ( java.lang.Exception e ) { log.warnFormat ( "Failed to initiate vdsm-id request on host" , e ) ; return null ; } }
Source:
public void setup ( ) { initVds ( ) ; initConditions ( ) ; org.mockito.Mockito.when ( vdsManager.isTimeToRefreshStatistics ( ) ) . thenReturn ( false ) ; updater = new org.ovirt.engine.core.vdsbroker.monitoring.HostMonitoring ( vdsManager , vds , org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategy.class ) , resourceManager , dbFacade , auditLogDirector ) ; }

Target:
public void setup ( ) { initVds ( ) ; initConditions ( ) ; updater = new org.ovirt.engine.core.vdsbroker.monitoring.HostMonitoring ( vdsManager , vds , org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.monitoring.MonitoringStrategy.class ) , resourceManager , dbFacade , auditLogDirector ) ; }
Source:
public void testEquals ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p1 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p2 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p3 = new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > ( false , "abc" ) ; org.junit.Assert.assertTrue ( p1.equals ( p2 ) ) ; org.junit.Assert.assertFalse ( p1.equals ( p3 ) ) ; }

Target:
public void testEquals ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p1 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p2 = new org.ovirt.engine.core.common.utils.Pair ( true , "abc" ) ; org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.String > p3 = new org.ovirt.engine.core.common.utils.Pair ( false , "abc" ) ; org.junit.Assert.assertTrue ( p1.equals ( p2 ) ) ; org.junit.Assert.assertFalse ( p1.equals ( p3 ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > geoRepSessions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ) ( returnValue ) ) ; if ( ( getItems ( ) ) == geoRepSessions ) { getItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; } else { java.util.Collections.sort ( geoRepSessions , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeGeoRepSessionComparer ( ) ) ; setItems ( geoRepSessions ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > geoRepSessions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ) ( returnValue ) ) ; java.util.Collections.sort ( geoRepSessions , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeGeoRepSessionComparer ( ) ) ; setItems ( geoRepSessions ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand < org.ovirt.engine.core.common.action.RemoveAuditLogByIdParameters > command ) { org.mockito.Mockito.doReturn ( auditLogDao ) . when ( command ) . getAuditLogDao ( ) ; org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_3 ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( auditLogDao ) . when ( command ) . getAuditLogDao ( ) ; org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_3 ) ; }
Source:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setPayload ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setCertificateInfo ( this , model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setPayload ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setCertificateInfo ( this , model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; return model ; }
Source:
protected org.ovirt.engine.core.compat.Guid ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getCommandId ( ) ) ) ; p.setEntityId ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getParameters ( ) . getEntityId ( ) ) ; org.ovirt.engine.core.compat.Guid ret = org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( AsyncTaskType.mergeSnapshots , p , false ) ; return ret ; }

Target:
protected org.ovirt.engine.core.compat.Guid ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getCommandId ( ) ) ) ; p.setEntityId ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getParameters ( ) . getEntityId ( ) ) ; org.ovirt.engine.core.compat.Guid ret = org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( AsyncTaskType.mergeSnapshots , p ) ; return ret ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) . getValue ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ) . isWipeAfterDelete ( ) , getEnclosingCommand ( ) . getParameters ( ) . getForceDelete ( ) , null ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ) . isWipeAfterDelete ( ) , getEnclosingCommand ( ) . getParameters ( ) . getForceDelete ( ) , null ) ; }
Source:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.supportedInConfig ( ConfigValues.GlusterEventingSupported , org.ovirt.engine.core.bll.gluster.AddGlusterWebhookInternalCommand.getCluster ( ) . getCompatibilityVersion ( ) ) ) ) { return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.supportedInConfig ( ConfigValues.GlusterEventingSupported , org.ovirt.engine.core.bll.gluster.AddGlusterWebhookInternalCommand.getCluster ( ) . getCompatibilityVersion ( ) ) ) ) { return false ; } return true ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.events.AlertListModel alertListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.events.AlertListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AuditLog > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AuditLog > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; alertListModel.setItems ( list ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.events.AlertListModel alertListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.events.AlertListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AuditLog > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AuditLog > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; alertListModel.setItems ( list ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStoragePoolDao ( ) ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setstatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; vdsGroup = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; newPool.setname ( "newPoolDude" ) ; newPool.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.0" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setstatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; vdsGroup = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; newPool.setname ( "newPoolDude" ) ; newPool.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.0" ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { boolean filteringLUNsEnabled = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . isFilteringLUNsEnabled ( ) ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; options.add ( VdsProperties.includePartitioned , java.lang.Boolean.toString ( filteringLUNsEnabled ) ) ; int storageType = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) ; _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getBroker ( ) . getDeviceList ( storageType , options ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLUNList ( _result.lunList ) ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { int storageType = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) ; _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getBroker ( ) . getDeviceList ( storageType ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLUNList ( _result.lunList ) ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3Disk get ( ) { org.ovirt.engine.api.v3.types.V3Disk disk = adaptGet ( getDelegate ( ) :: get ) ; org.ovirt.engine.api.model.DiskAttachment diskAttachment = org.ovirt.engine.api.restapi.resource.BackendApiResource.getInstance ( ) . getVmsResource ( ) . getVmResource ( vmId ) . getDiskAttachmentsResource ( ) . getAttachmentResource ( diskId ) . get ( ) ; disk.setBootable ( diskAttachment.isBootable ( ) ) ; disk.setInterface ( diskAttachment.getInterface ( ) . toString ( ) . toLowerCase ( ) ) ; return disk ; }

Target:
public org.ovirt.engine.api.v3.types.V3Disk get ( ) { return adaptGet ( getDelegate ( ) :: get ) ; }
Source:
private void commonInitialize ( ) { super . initialize ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand onSaveCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; onSaveCommand.setTitle ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.ok ( ) ) ; onSaveCommand.setIsDefault ( true ) ; getCommands ( ) . add ( onSaveCommand ) ; getCommands ( ) . add ( getCancelCommand ( ) ) ; if ( ( getVm ( ) ) != null ) { updateBootableDiskAvailable ( ) ; getIsUsingScsiReservation ( ) . setIsAvailable ( true ) ; } updateDatacenters ( ) ; }

Target:
protected void commonInitialize ( ) { super . initialize ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand onSaveCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; onSaveCommand.setTitle ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.ok ( ) ) ; onSaveCommand.setIsDefault ( true ) ; getCommands ( ) . add ( onSaveCommand ) ; getCommands ( ) . add ( getCancelCommand ( ) ) ; if ( ( getVm ( ) ) != null ) { updateBootableDiskAvailable ( ) ; getIsUsingScsiReservation ( ) . setIsAvailable ( true ) ; } updateDatacenters ( ) ; }
Source:
public void testGetValue ( ) { org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , "3.0" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , "3.1" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.NonVmNetworkSupported , "3.2" ) ) ; }

Target:
public void testGetValue ( ) { org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.NonVmNetworkSupported , "3.0" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.NonVmNetworkSupported , "3.1" ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.NonVmNetworkSupported , "3.2" ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyClusterListModel clusterPolicyClusterListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.ClusterPolicyClusterListModel ) ( model ) ) ; clusterPolicyClusterListModel.setItems ( ( ( java.util.Collection ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.Collection ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getVdsName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getVdsName ( ) , e.getMessage ( ) ) ; } }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getName ( ) , e.getMessage ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePoolId ( ) ) == null ? null : org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePoolId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePoolId ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < java.lang.String > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.String [ ] array = ( ( java.lang.String ) ( source ) ) . split ( "[,]" , ( - 1 ) ) ; for ( java.lang.String item : array ) { list.add ( item ) ; } } return list ; }

Target:
public java.util.List < java.lang.String > convert ( java.lang.Object source ) { java.util.ArrayList < java.lang.String > list = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.String [ ] array = ( ( java.lang.String ) ( source ) ) . split ( "[,]" , ( - 1 ) ) ; for ( java.lang.String item : array ) { list.add ( item ) ; } } return list ; }
Source:
private void mockStorageDomainDAOGetForStoragePool ( int domainSpaceGB ) { org.powermock.api.mockito.PowerMockito.when ( sdDAO.getForStoragePool ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.< org.ovirt.engine.core.compat.NGuid > any ( org.ovirt.engine.core.compat.NGuid.class ) ) ) . thenReturn ( createStorageDomain ( domainSpaceGB ) ) ; }

Target:
private void mockStorageDomainDAOGetForStoragePool ( int domainSpaceGB ) { org.mockito.Mockito.when ( sdDAO.getForStoragePool ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.< org.ovirt.engine.core.compat.NGuid > any ( org.ovirt.engine.core.compat.NGuid.class ) ) ) . thenReturn ( createStorageDomain ( domainSpaceGB ) ) ; }
Source:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { int selectedIndex = bootSequenceBox.getSelectedIndex ( ) ; bootSequenceModel.setSelectedItem ( bootSequenceModel.getItems ( ) . get ( selectedIndex ) ) ; bootSequenceUpButton.setEnabled ( bootSequenceModel.getMoveItemUpCommand ( ) . getIsExecutionAllowed ( ) ) ; bootSequenceDownButton.setEnabled ( bootSequenceModel.getMoveItemDownCommand ( ) . getIsExecutionAllowed ( ) ) ; localizeBootSequenceButtons ( ) ; }

Target:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { int selectedIndex = bootSequenceBox.getSelectedIndex ( ) ; bootSequenceModel.setSelectedItem ( bootSequenceModel.getItems ( ) . get ( selectedIndex ) ) ; bootSequenceUpButton.setEnabled ( bootSequenceModel.getMoveItemUpCommand ( ) . getIsExecutionAllowed ( ) ) ; bootSequenceDownButton.setEnabled ( bootSequenceModel.getMoveItemDownCommand ( ) . getIsExecutionAllowed ( ) ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3IpAddressAssignment adapt ( org.ovirt.engine.api.model.IpAddressAssignment from ) { org.ovirt.engine.api.v3.types.V3IpAddressAssignment to = new org.ovirt.engine.api.v3.types.V3IpAddressAssignment ( ) ; if ( from.isSetAssignmentMethod ( ) ) { to.setAssignmentMethod ( from.getAssignmentMethod ( ) ) ; } if ( from.isSetIp ( ) ) { to.setIp ( org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( from.getIp ( ) ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.v3.types.V3IpAddressAssignment adapt ( org.ovirt.engine.api.model.IpAddressAssignment from ) { org.ovirt.engine.api.v3.types.V3IpAddressAssignment to = new org.ovirt.engine.api.v3.types.V3IpAddressAssignment ( ) ; if ( from.isSetAssignmentMethod ( ) ) { to.setAssignmentMethod ( from.getAssignmentMethod ( ) . value ( ) ) ; } if ( from.isSetIp ( ) ) { to.setIp ( org.ovirt.engine.api.v3.adapters.V3OutAdapters.adaptOut ( from.getIp ( ) ) ) ; } return to ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( ( other != null ) && ( other instanceof org.ovirt.engine.core.utils.customprop.ValidationError ) ) { org.ovirt.engine.core.utils.customprop.ValidationError otherError = ( ( org.ovirt.engine.core.utils.customprop.ValidationError ) ( other ) ) ; return ( keyName.equals ( otherError.getKeyName ( ) ) ) && ( ( reason ) == ( otherError.getReason ( ) ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof org.ovirt.engine.core.utils.customprop.ValidationError ) { org.ovirt.engine.core.utils.customprop.ValidationError otherError = ( ( org.ovirt.engine.core.utils.customprop.ValidationError ) ( other ) ) ; return ( keyName.equals ( otherError.getKeyName ( ) ) ) && ( ( reason ) == ( otherError.getReason ( ) ) ) ; } return false ; }
Source:
private void mockDaoForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getQuotaDao ( ) ) . thenReturn ( quotaDao ) ; returnedQuotas = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getAdElementId ( ) ) . thenReturn ( adElementId ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; org.mockito.Mockito.when ( quotaDao.getQuotaByAdElementId ( adElementId , storagePoolId , false ) ) . thenReturn ( returnedQuotas ) ; }

Target:
private void mockDaoForQuery ( ) { returnedQuotas = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getAdElementId ( ) ) . thenReturn ( adElementId ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getStoragePoolId ( ) ) . thenReturn ( storagePoolId ) ; org.mockito.Mockito.when ( quotaDao.getQuotaByAdElementId ( adElementId , storagePoolId , false ) ) . thenReturn ( returnedQuotas ) ; }
Source:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }

Target:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.businessentities.ArchitectureType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }
Source:
private void generateEnumReadOne ( org.ovirt.api.metamodel.concepts.EnumType type ) { org.ovirt.api.metamodel.tool.JavaClassName typeName = javaTypes.getEnumName ( type ) ; javaBuffer.addImport ( typeName ) ; javaBuffer.addImport ( org.ovirt.api.metamodel.runtime.json.JsonReader.class ) ; javaBuffer.addImport ( JsonParser.Event.class ) ; javaBuffer.addLine ( "public static %1$s readOne(JsonReader reader) {" , typeName.getSimpleName ( ) ) ; javaBuffer.addLine ( "return %1$s.fromValue(reader.readString());" , typeName.getSimpleName ( ) ) ; javaBuffer.addLine ( "}" ) ; javaBuffer.addLine ( ) ; }

Target:
private void generateEnumReadOne ( org.ovirt.api.metamodel.concepts.EnumType type ) { org.ovirt.api.metamodel.tool.JavaClassName typeName = javaTypes.getEnumName ( type ) ; javaBuffer.addImport ( typeName ) ; javaBuffer.addImport ( org.ovirt.api.metamodel.runtime.json.JsonReader.class ) ; javaBuffer.addLine ( "public static %1$s readOne(JsonReader reader) {" , typeName.getSimpleName ( ) ) ; javaBuffer.addLine ( "return %1$s.fromValue(reader.readString());" , typeName.getSimpleName ( ) ) ; javaBuffer.addLine ( "}" ) ; javaBuffer.addLine ( ) ; }
Source:
protected void cancel ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosItems = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( getQos ( ) . getItems ( ) ) ) ) ; qosItems.add ( 1 , networkQoS ) ; getQos ( ) . setItems ( qosItems ) ; getQos ( ) . setSelectedItem ( networkQoS ) ; sourceListModel.setConfirmWindow ( null ) ; }

Target:
protected void cancel ( ) { sourceListModel.setConfirmWindow ( null ) ; }
Source:
private boolean isLibrbdAvailable ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.CINDERStorageHelper.isLibrbdAvailable ( getVds ( ) ) ) ) { log.error ( "Couldn't found librbd1 package on vds (needed for Cinder storage domains)." , getVds ( ) . getName ( ) ) ; setNonOperational ( NonOperationalReason.LIBRBD_PACKAGE_NOT_AVAILABLE , getVds ( ) ) ; return false ; } return true ; }

Target:
private boolean isLibrbdAvailable ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.CINDERStorageHelper.isLibrbdAvailable ( getVds ( ) ) ) ) { log.error ( "Couldn't found librbd1 package on vds (needed for Cinder storage domains)." , getVds ( ) . getName ( ) ) ; setNonOperational ( NonOperationalReason.LIBRBD_PACKAGE_NOT_AVAILABLE ) ; return false ; } return true ; }
Source:
private static void assertGetAllForStoragePoolResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result , org.ovirt.engine.core.compat.Guid expectedStoragePoolId ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : result ) { org.junit.Assert.assertEquals ( expectedStoragePoolId , domain.getStoragePoolId ( ) ) ; } }

Target:
private static void assertGetAllForStoragePoolResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result , org.ovirt.engine.core.compat.Guid expectedStoragePoolId ) { org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : result ) { org.junit.Assert.assertEquals ( expectedStoragePoolId , domain.getStoragePoolId ( ) ) ; } }
Source:
private java.lang.String getManagementIp ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementIp = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementIp = _vds.getManagmentIp ( ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementIp = _vds.getPmSecondaryIp ( ) ; } return managementIp ; }

Target:
private java.lang.String getManagementIp ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementIp = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementIp = _vds.getManagementIp ( ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementIp = _vds.getPmSecondaryIp ( ) ; } return managementIp ; }
Source:
public void setupMocks ( ) { org.mockito.Mockito.when ( vdsGroupDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getFromCache ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getVdsGroup ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDAO ( ) ; org.mockito.Mockito.when ( cmd.getSyncJobInstance ( ) ) . thenReturn ( hookSyncJob ) ; }

Target:
public void setupMocks ( ) { org.mockito.Mockito.when ( vdsGroupDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getVdsGroup ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDAO ( ) ; org.mockito.Mockito.when ( cmd.getSyncJobInstance ( ) ) . thenReturn ( hookSyncJob ) ; }
Source:
public org.ovirt.engine.api.model.Hosts list ( ) { if ( isFiltered ( ) ) { throw new javax.ws.rs.WebApplicationException ( Response.Status.FORBIDDEN ) ; } org.ovirt.engine.core.common.mode.ApplicationMode appMode = getCurrent ( ) . get ( org.ovirt.engine.core.common.mode.ApplicationMode.class ) ; if ( appMode == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { return listGlusterOnly ( ) ; } else { return listAll ( ) ; } }

Target:
public org.ovirt.engine.api.model.Hosts list ( ) { org.ovirt.engine.core.common.mode.ApplicationMode appMode = getCurrent ( ) . get ( org.ovirt.engine.core.common.mode.ApplicationMode.class ) ; if ( appMode == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { return listGlusterOnly ( ) ; } else { return listAll ( ) ; } }
Source:
private void showSessionOptions ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession selectedGeoRepSession = getSelectedItem ( ) ; org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeGeoReplicationSessionConfigModel configModel = new org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeGeoReplicationSessionConfigModel ( selectedGeoRepSession ) ; configModel.setTitle ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeoRepListModel.constants.geoReplicationOptions ( ) ) ; configModel.setHashName ( "volume_geo_rep_configuration_display" ) ; configModel.setHelpTag ( HelpTag.volume_geo_rep_configuration_display ) ; configModel.startProgress ( null ) ; fetchConfigForSession ( selectedGeoRepSession ) ; setWindow ( configModel ) ; addUICommandsToConfigWindow ( configModel ) ; }

Target:
private void showSessionOptions ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession selectedGeoRepSession = getSelectedItem ( ) ; org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeGeoReplicationSessionConfigModel configModel = new org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeGeoReplicationSessionConfigModel ( selectedGeoRepSession ) ; configModel.setTitle ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeoRepListModel.constants.geoReplicationOptions ( ) ) ; configModel.setHashName ( "volume_geo_rep_configuration_display" ) ; configModel.setHelpTag ( HelpTag.volume_geo_rep_configuration_display ) ; configModel.startProgress ( ) ; fetchConfigForSession ( selectedGeoRepSession ) ; setWindow ( configModel ) ; addUICommandsToConfigWindow ( configModel ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewSnapshotCommand ( ) ) ) { return snapshotPopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeSnapshotListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }