auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void addStyles ( ) { activateDomainEditor.addContentWidgetContainerStyleName ( style.activateDomainEditor ( ) ) ; advancedParametersExpanderContent.setStyleName ( style.advancedParametersExpanderContent ( ) ) ; warningLowSpaceIndicatorEditor.addContentWidgetContainerStyleName ( style.warningTextBoxEditor ( ) ) ; criticalSpaceActionBlockerEditor.addContentWidgetStyleName ( style.blockerTextBoxEditor ( ) ) ; formatListEditor.addContentWidgetStyleName ( style.formatListEditor ( ) ) ; }

Target:
void addStyles ( ) { advancedParametersExpanderContent.setStyleName ( style.advancedParametersExpanderContent ( ) ) ; warningLowSpaceIndicatorEditor.addContentWidgetContainerStyleName ( style.warningTextBoxEditor ( ) ) ; criticalSpaceActionBlockerEditor.addContentWidgetStyleName ( style.blockerTextBoxEditor ( ) ) ; formatListEditor.addContentWidgetStyleName ( style.formatListEditor ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = FixturesTool.VM_RHEL5_POOL_50 ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( new java.util.LinkedList < > ( java.util.Collections.singletonList ( "groups" ) ) ) ; newUser.setNamespace ( "*" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vm = FixturesTool.VM_RHEL5_POOL_50 ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( new java.util.LinkedList < > ( java.util.Collections.singletonList ( "groups" ) ) ) ; newUser.setNamespace ( "*" ) ; }
Source:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.powermock.api.mockito.PowerMockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( false ) ; }

Target:
protected void cretaeVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setImageId ( diskImageGuid ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setactive ( true ) ; disk.setvm_guid ( vmId ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; mockVmDevice ( false ) ; }
Source:
protected void loadExternalScheduler ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler discovery thread" ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( exSchedulerDiscovery.discover ( ) ) { reloadPolicyUnits ( ) ; } } } ) ; } else { exSchedulerDiscovery.markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } }

Target:
private void loadExternalScheduler ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler discovery thread" ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( exSchedulerDiscovery.discover ( ) ) { reloadPolicyUnits ( ) ; } } } ) ; } else { exSchedulerDiscovery.markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }
Source:
void initAlertEventFooterPanel ( org.ovirt.engine.ui.webadmin.uicommon.model.AlertModelProvider alertModelProvider , org.ovirt.engine.ui.webadmin.uicommon.model.EventModelProvider eventModelProvider , org.ovirt.engine.ui.webadmin.uicommon.model.TaskModelProvider taskModelProvider , org.ovirt.engine.ui.webadmin.ApplicationResources resources , org.ovirt.engine.ui.webadmin.ApplicationTemplates templates , com.google.gwt.event.shared.EventBus eventBus , org.ovirt.engine.ui.common.system.ClientStorage clientStorage , org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { alertEventFooterPanel.add ( new org.ovirt.engine.ui.webadmin.widget.footer.AlertsEventsFooterView ( alertModelProvider , eventModelProvider , taskModelProvider , resources , templates , eventBus , clientStorage , constants ) ) ; }

Target:
void initAlertEventFooterPanel ( org.ovirt.engine.ui.webadmin.uicommon.model.AlertModelProvider alertModelProvider , org.ovirt.engine.ui.webadmin.uicommon.model.EventModelProvider eventModelProvider , org.ovirt.engine.ui.webadmin.uicommon.model.TaskModelProvider taskModelProvider , com.google.gwt.event.shared.EventBus eventBus , org.ovirt.engine.ui.common.system.ClientStorage clientStorage ) { alertEventFooterPanel.add ( new org.ovirt.engine.ui.webadmin.widget.footer.AlertsEventsFooterView ( alertModelProvider , eventModelProvider , taskModelProvider , eventBus , clientStorage ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { file = new java.io.File ( this . getClass ( ) . getResource ( "small_file.txt" ) . toURI ( ) ) ; testServlet = new org.ovirt.engine.core.utils.servlet.FileServlet ( ) ; javax.servlet.ServletContext mockContext = org.mockito.Mockito.mock ( javax.servlet.ServletContext.class ) ; org.mockito.Mockito.when ( mockConfig.getServletContext ( ) ) . thenReturn ( mockContext ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { file = new java.io.File ( this . getClass ( ) . getResource ( "small_file.txt" ) . toURI ( ) ) ; testServlet = new org.ovirt.engine.core.utils.servlet.FileServlet ( ) ; }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToDaily ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToDaily ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
public void testFetchSpecificQuotaUsageForSpecificVdsGroup ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = dao.getQuotaVdsGroupByVdsGroupGuid ( FixturesTool.VDS_GROUP_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaVdsGroup quotaVdsGroup = quotaVdsGroupList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaVdsGroup ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroupList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertEquals ( quotaVdsGroup.getVirtualCpu ( ) , new java.lang.Integer ( 10 ) ) ; }

Target:
public void testFetchSpecificQuotaUsageForSpecificVdsGroup ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = dao.getQuotaVdsGroupByVdsGroupGuid ( FixturesTool.VDS_GROUP_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.ovirt.engine.core.common.businessentities.QuotaVdsGroup quotaVdsGroup = quotaVdsGroupList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaVdsGroup ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroupList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertEquals ( quotaVdsGroup.getVirtualCpu ( ) , java.lang.Integer.valueOf ( 10 ) ) ; }
Source:
private org.apache.http.conn.ClientConnectionManager createPoolingClientConnectionManager ( java.lang.String url , java.lang.Integer port ) { org.apache.http.conn.scheme.SchemeRegistry schemeRegistry = createSchemeRegistry ( url , port ) ; org.apache.http.impl.conn.PoolingClientConnectionManager cm = new org.apache.http.impl.conn.PoolingClientConnectionManager ( schemeRegistry ) ; cm.setMaxTotal ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS ) ; cm.setDefaultMaxPerRoute ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_ROUTE ) ; cm.setMaxPerRoute ( new org.apache.http.conn.routing.HttpRoute ( new org.apache.http.HttpHost ( getHost ( url ) , getPort ( url , port ) ) ) , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_HOST ) ; new org.ovirt.engine.sdk.web.IdleConnectionMonitorThread ( cm , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.WAIT_IDLE_CHECK_TTL , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.WAIT_IDLE_CLOSE_TTL ) . start ( ) ; return cm ; }

Target:
private org.apache.http.conn.ClientConnectionManager createPoolingClientConnectionManager ( java.lang.String url , int port ) { org.apache.http.conn.scheme.SchemeRegistry schemeRegistry = createSchemeRegistry ( url , port ) ; org.apache.http.impl.conn.PoolingClientConnectionManager cm = new org.apache.http.impl.conn.PoolingClientConnectionManager ( schemeRegistry ) ; cm.setMaxTotal ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS ) ; cm.setDefaultMaxPerRoute ( org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_ROUTE ) ; cm.setMaxPerRoute ( new org.apache.http.conn.routing.HttpRoute ( new org.apache.http.HttpHost ( getHost ( url ) , getPort ( url , port ) ) ) , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.MAX_CONNECTIONS_PER_HOST ) ; new org.ovirt.engine.sdk.web.IdleConnectionMonitorThread ( cm , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.WAIT_IDLE_CHECK_TTL , org.ovirt.engine.sdk.web.ConnectionsPoolBuilder.WAIT_IDLE_CLOSE_TTL ) . start ( ) ; return cm ; }
Source:
private static void failureEventHandler ( java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( errorMessage ) ; }

Target:
private static void failureEventHandler ( java.lang.Throwable caught ) { java.lang.String errorMessage ; if ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) { errorMessage = ( ( org.ovirt.engine.ui.frontend.Frontend.getConstants ( ) . requestToServerFailedWithCode ( ) ) + ": " ) + ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) ; } else { errorMessage = ( ( org.ovirt.engine.ui.frontend.Frontend.getConstants ( ) . requestToServerFailed ( ) ) + ": " ) + ( caught.getLocalizedMessage ( ) ) ; } org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( errorMessage ) ; }
Source:
public void testRemoveStoragePoolIsoMap ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_id ( ) . toString ( ) ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemoveStoragePoolIsoMap ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
public static < T > java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > toEntityModelList ( java.util.ArrayList < T > list ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > entityModelList = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; if ( list != null ) { for ( java.lang.Object item : list ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel model = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; model.setEntity ( item ) ; entityModelList.add ( model ) ; } } return entityModelList ; }

Target:
public static < T > java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > > toEntityModelList ( java.util.ArrayList < T > list ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > > entityModelList = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > > ( ) ; if ( list != null ) { for ( T item : list ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > model = new org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > ( ) ; model.setEntity ( item ) ; entityModelList.add ( model ) ; } } return entityModelList ; }
Source:
private void initCommand ( ) { final org.ovirt.engine.core.compat.Guid sourceSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; command = setupCanAddVmFromSnapshotTests ( 0 , 0 , sourceSnapshotId ) ; generateStorageToDisksMap ( command ) ; initDestSDs ( command ) ; storageDomainValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.class ) ; snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; }

Target:
private void initCommand ( ) { final org.ovirt.engine.core.compat.Guid sourceSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; command = setupCanAddVmFromSnapshotTests ( 0 , sourceSnapshotId ) ; generateStorageToDisksMap ( command ) ; initDestSDs ( command ) ; storageDomainValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.class ) ; snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( ( permsList ) == null ) && ( ( getDisk ( ) ) != null ) ) { permsList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getDisk ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.ATTACH_DISK ) ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getDisk ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_DISK_PROPERTIES ) ) ; } return permsList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( ( permsList ) == null ) && ( ( getDisk ( ) ) != null ) ) { permsList = new java.util.ArrayList < > ( ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getDisk ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.ATTACH_DISK ) ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getDisk ( ) . getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_DISK_PROPERTIES ) ) ; } return permsList ; }
Source:
public void exampleToMapDefaultMapper ( ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.utils.linq.LinqUtils.toMap ( list , new org.ovirt.engine.core.utils.linq.DefaultMapper < java.lang.String , java.lang.String > ( ) { @ java.lang.Override public java.lang.String createKey ( java.lang.String s ) { return s.substring ( 0 , 1 ) ; } } ) ; java.util.Map < java.lang.String , java.lang.String > example = new java.util.HashMap < java.lang.String , java.lang.String > ( ) { { put ( "t" , "three" ) ; put ( "o" , "one" ) ; } } ; org.junit.Assert.assertEquals ( map , example ) ; }

Target:
public void exampleToMapDefaultMapper ( ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.utils.linq.LinqUtils.toMap ( list , new org.ovirt.engine.core.utils.linq.DefaultMapper < java.lang.String , java.lang.String > ( ) { @ java.lang.Override public java.lang.String createKey ( java.lang.String s ) { return s.substring ( 0 , 1 ) ; } } ) ; java.util.Map < java.lang.String , java.lang.String > example = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; example.put ( "t" , "three" ) ; example.put ( "o" , "one" ) ; org.junit.Assert.assertEquals ( map , example ) ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( cmd ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STOPPED_VOLUME_ID ) ) . when ( volumeDao ) . getById ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STOPPED_VOLUME_ID ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STARTED_VOLUME_ID ) ) . when ( volumeDao ) . getById ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STARTED_VOLUME_ID ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STOPPED_VOLUME_ID ) ) . when ( volumeDao ) . getById ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STOPPED_VOLUME_ID ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STARTED_VOLUME_ID ) ) . when ( volumeDao ) . getById ( org.ovirt.engine.core.bll.gluster.StartGlusterVolumeProfileCommandTest.STARTED_VOLUME_ID ) ; }
Source:
private static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getManagementNetworkUtil ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , host.getVdsGroupId ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }

Target:
public static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getManagementNetworkUtil ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , host.getVdsGroupId ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < T > event ) { T value = event.getValue ( ) ; boolean becomingGhost = isGhost ( value ) ; if ( becomingGhost != ( wasGhost ) ) { ( ( org.ovirt.engine.ui.common.widget.AddRemoveRowWidget < M , T , V > . AddRemoveRowPanel ) ( widget.getParent ( ) ) ) . setButtonEnabled ( ( ! becomingGhost ) ) ; toggleGhost ( value , widget , becomingGhost ) ; wasGhost = becomingGhost ; } }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < T > event ) { T value = event.getValue ( ) ; boolean becomingGhost = isGhost ( value ) ; if ( becomingGhost != ( wasGhost ) ) { setButtonEnabled ( widget , ( ! becomingGhost ) ) ; toggleGhost ( value , widget , becomingGhost ) ; wasGhost = becomingGhost ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel clusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( model ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.ArrayList < org.ovirt.engine.core.compat.Version > versions = ( ( java.util.ArrayList < org.ovirt.engine.core.compat.Version > ) ( result ) ) ; org.ovirt.engine.core.compat.Version versionToSelect = calculateNewVersionWhichShouldBeSelected ( clusterModel , versions ) ; clusterModel.getVersion ( ) . setItems ( versions , versionToSelect ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.compat.Version > versions ) { org.ovirt.engine.core.compat.Version versionToSelect = calculateNewVersionWhichShouldBeSelected ( versions ) ; getVersion ( ) . setItems ( versions , versionToSelect ) ; }
Source:
public void mockConfig ( ) { java.util.HashSet < org.ovirt.engine.core.compat.Version > supportedClusters = new java.util.HashSet < > ( ) ; supportedClusters.add ( version ) ; org.mockito.Mockito.when ( host.getSupportedClusterVersionsSet ( ) ) . thenReturn ( supportedClusters ) ; org.mockito.Mockito.when ( host.getClusterCompatibilityVersion ( ) ) . thenReturn ( version ) ; configRule.mockConfigValue ( ConfigValues.DefaultRouteSupported , version , java.lang.Boolean.FALSE ) ; configRule.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; configRule.mockConfigValue ( ConfigValues.HostNetworkQosSupported , version , false ) ; }

Target:
public void mockConfig ( ) { org.mockito.Mockito.when ( host.getClusterCompatibilityVersion ( ) ) . thenReturn ( version ) ; configRule.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; configRule.mockConfigValue ( ConfigValues.HostNetworkQosSupported , version , false ) ; }
Source:
protected org.ovirt.engine.api.model.VM getEntity ( ) { for ( org.ovirt.engine.api.model.VM entity : parent.getEntitiesFromExportDomain ( ) ) { if ( guid.equals ( entity.getId ( ) ) ) { return entity ; } } return entityNotFound ( ) ; }

Target:
protected org.ovirt.engine.api.model.VM getEntity ( ) { if ( ( vm ) != null ) { return vm ; } for ( org.ovirt.engine.api.model.VM entity : parent.getEntitiesFromExportDomain ( ) ) { if ( guid.equals ( entity.getId ( ) ) ) { vm = entity ; return entity ; } } return entityNotFound ( ) ; }
Source:
public void storagePoolIdWithStoragePool ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setStoragePoolId ( null ) ; final org.ovirt.engine.core.common.businessentities.storage_pool p = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; p.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStoragePool ( p ) ; final org.ovirt.engine.core.compat.NGuid n = b.getStoragePoolId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }

Target:
public void storagePoolIdWithStoragePool ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setStoragePoolId ( null ) ; final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; p.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStoragePool ( p ) ; final org.ovirt.engine.core.compat.NGuid n = b.getStoragePoolId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }
Source:
private boolean isEditAvailable ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { if ( storageDomain == null ) { return false ; } boolean isActive = ( ( storageDomain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Active ) ) || ( ( storageDomain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Mixed ) ) ; boolean isBlockStorage = storageDomain.getstorage_type ( ) . isBlockDomain ( ) ; return isBlockStorage ? true : isActive ; }

Target:
private boolean isEditAvailable ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( storageDomain == null ) { return false ; } boolean isActive = ( ( storageDomain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Active ) ) || ( ( storageDomain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Mixed ) ) ; boolean isBlockStorage = storageDomain.getstorage_type ( ) . isBlockDomain ( ) ; return isBlockStorage ? true : isActive ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.User model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( EXTERNAL_IDS [ index ] . toHex ( ) , model.getExternalId ( ) ) ; assertEquals ( ( ( ( NAMES [ index ] ) + "@" ) + ( DOMAIN ) ) , model.getUserName ( ) ) ; assertNotNull ( model.getDomain ( ) ) ; assertEquals ( new org.ovirt.engine.core.compat.Guid ( org.ovirt.engine.api.restapi.resource.DOMAIN.getBytes ( ) , true ) . toString ( ) , model.getDomain ( ) . getId ( ) ) ; assertTrue ( model.isSetGroups ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.PARSED_GROUPS.length , model.getGroups ( ) . getGroups ( ) . size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.PARSED_GROUPS.length ) ; i ++ ) { org.ovirt.engine.api.model.Group group = model.getGroups ( ) . getGroups ( ) . get ( i ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.PARSED_GROUPS [ i ] , group.getName ( ) ) ; } verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.User model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( ( ( ( NAMES [ index ] ) + "@" ) + ( DOMAIN ) ) , model.getUserName ( ) ) ; assertNotNull ( model.getDomain ( ) ) ; assertEquals ( new org.ovirt.engine.core.compat.Guid ( org.ovirt.engine.api.restapi.resource.DOMAIN.getBytes ( ) , true ) . toString ( ) , model.getDomain ( ) . getId ( ) ) ; assertTrue ( model.isSetGroups ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.PARSED_GROUPS.length , model.getGroups ( ) . getGroups ( ) . size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.PARSED_GROUPS.length ) ; i ++ ) { org.ovirt.engine.api.model.Group group = model.getGroups ( ) . getGroups ( ) . get ( i ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.PARSED_GROUPS [ i ] , group.getName ( ) ) ; } verifyLinks ( model ) ; }
Source:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.lang.String compatibleVersions , java.lang.String vdsSupportedVersions ) { java.util.Map < java.lang.String , java.lang.String > customLogValues = new java.util.HashMap < > ( ) ; customLogValues.put ( "CompatibilityVersion" , compatibleVersions ) ; customLogValues.put ( "VdsSupportedVersions" , vdsSupportedVersions ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getContext ( ) ) ) ; }

Target:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.lang.String compatibleVersions , java.lang.String vdsSupportedVersions ) { java.util.Map < java.lang.String , java.lang.String > customLogValues = new java.util.HashMap < > ( ) ; customLogValues.put ( "CompatibilityVersion" , compatibleVersions ) ; customLogValues.put ( "VdsSupportedVersions" , vdsSupportedVersions ) ; reportNonOperationReason ( reason , customLogValues ) ; }
Source:
protected void onEntityContentChanged ( ) { super . onEntityContentChanged ( ) ; if ( ( ( getEntity ( ) ) != null ) && ( ! ( ( getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VmPool ) ) ) { getSearchCommand ( ) . execute ( ) ; } else { setItems ( null ) ; } }

Target:
protected void onEntityContentChanged ( ) { super . onEntityContentChanged ( ) ; if ( ( getEntity ( ) ) != null ) { getSearchCommand ( ) . execute ( ) ; } else { setItems ( null ) ; } }
Source:
public void setup ( ) { urlValidation = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.uicommonweb.validation.UrlValidation ( new java.lang.String [ ] { org.ovirt.engine.ui.uicommonweb.Uri.SCHEME_HTTP } ) ) ; hostValidation = new org.ovirt.engine.ui.uicommonweb.validation.UriHostAddressValidation ( null ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getUriMessage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getSchemeMessage ( org.mockito.ArgumentMatchers.anyString ( ) ) ; org.mockito.Mockito.doReturn ( hostValidation ) . when ( urlValidation ) . getHostValidation ( ) ; }

Target:
public void setup ( ) { urlValidation = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.uicommonweb.validation.UrlValidation ( new java.lang.String [ ] { org.ovirt.engine.ui.uicommonweb.Uri.SCHEME_HTTP } ) ) ; hostValidation = new org.ovirt.engine.ui.uicommonweb.validation.UriHostAddressValidation ( null ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getUriMessage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getSchemeMessage ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( hostValidation ) . when ( urlValidation ) . getHostValidation ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRemoveBrick ( getParameters ( ) . getBricks ( ) , getGlusterVolume ( ) , getParameters ( ) . getReplicaCount ( ) , false ) ) ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRemoveBrick ( getParameters ( ) . getBricks ( ) , getGlusterVolume ( ) , getParameters ( ) . getReplicaCount ( ) , false ) ) ; }
Source:
protected void initAppsTable ( ) { appsTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable < org.ovirt.engine.ui.uicommonweb.models.ListModel > ( false , true ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > appNameColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String appName ) { return appName ; } } ; appsTable.addColumn ( appNameColumn , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterEntityInfoPanel.constants.nameSnapshot ( ) ) ; appsTable.setRowData ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ) ; appsTable.setWidth ( "100%" , true ) ; appsTable.setSelectionModel ( new com.google.gwt.view.client.NoSelectionModel ( ) ) ; }

Target:
protected void initAppsTable ( ) { appsTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( false , true ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > appNameColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String appName ) { return appName ; } } ; appsTable.addColumn ( appNameColumn , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterEntityInfoPanel.constants.nameSnapshot ( ) ) ; appsTable.setRowData ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ) ; appsTable.setWidth ( "100%" , true ) ; appsTable.setSelectionModel ( new com.google.gwt.view.client.NoSelectionModel ( ) ) ; }
Source:
private void saveNfsStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveNfs" } ) ) ) . run ( ) ; }

Target:
private void saveNfsStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . startProgress ( ) ; org.ovirt.engine.ui.uicompat.Task.create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveNfs" } ) ) ) . run ( ) ; }
Source:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( null ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }
Source:
public static void initLinuxOsTypes ( ) { 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.linuxOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( 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.GetLinuxOss ) , callback ) ; }

Target:
public static void initLinuxOsTypes ( ) { 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.linuxOsIds = ( ( java.util.ArrayList < java.lang.Integer > ) ( ( ( 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.GetLinuxOss ) , callback ) ; }
Source:
public void testAddHostedEngineStorageFails ( ) { org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getAllLuns ( ) ; parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertFalse ( command.canAddDomain ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Add self hosted engine storage domain succeeded where it should have failed" , command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }

Target:
public void testAddHostedEngineStorageFails ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getAllLuns ( ) ; parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertFalse ( command.canAddDomain ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Add self hosted engine storage domain succeeded where it should have failed" , command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }
Source:
private void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.StoragePool > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "DataCenter" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition < org.ovirt.engine.core.common.businessentities.StoragePool > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabDataCenterView.constants.showReportDC ( ) , resourceSubActions ) ) ; } } }

Target:
private void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.StoragePool > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "DataCenter" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabDataCenterView.constants.showReportDC ( ) , resourceSubActions ) ) ; } } }
Source:
public void removeAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = java.util.Arrays.asList ( org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) ) ; org.mockito.Mockito.when ( vmNicDao.getAllForVm ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( interfaces ) ; vmInterfaceManager.removeAll ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface ) ; } }

Target:
public void removeAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = java.util.Arrays.asList ( org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) ) ; org.mockito.Mockito.when ( vmNicDao.getAllForVm ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( interfaces ) ; vmInterfaceManager.removeAll ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ; if ( vm == null ) { return ; } setVM ( vm ) ; syncSearch ( ) ; } }

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 ; } setVM ( vm ) ; syncSearch ( ) ; } }
Source:
public java.lang.String getTimerRefreshStatus ( ) { org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( ( ( ( ( ( isActive ( ) ? "Refresh Status: Active(" : "Inactive(" ) + ( isPaused ( ) ? "paused)" : "running)" ) ) + ":" ) + " Rate: " ) + ( rateCycle [ currentRate ] ) ) + "(" ) + ( ( getRefreshRate ( ) ) / 1000 ) ) + " sec)" ) ) ; return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . refreshInterval ( ( ( getRefreshRate ( ) ) / 1000 ) ) ; }

Target:
private java.lang.String getValue ( ) { org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( ( ( ( ( ( isActive ( ) ? "Refresh Status: Active(" : "Inactive(" ) + ( isPaused ( ) ? "paused)" : "running)" ) ) + ":" ) + " Rate: " ) + ( rateCycle [ currentRate ] ) ) + "(" ) + ( ( getRefreshRate ( ) ) / 1000 ) ) + " sec)" ) ) ; return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . refreshInterval ( ( ( getRefreshRate ( ) ) / 1000 ) ) ; }
Source:
private void assertAllDisksAreActive ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.storage.LunDisk ) { continue ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.common.businessentities.storage.DiskImage.class . cast ( disk ) ; org.junit.Assert.assertTrue ( "disk should be active" , diskImage.getActive ( ) ) ; } }

Target:
private void assertAllDisksAreActive ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.storage.LunDisk ) { continue ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.junit.Assert.assertTrue ( "disk should be active" , diskImage.getActive ( ) ) ; } }
Source:
public final void AddField ( java.lang.Enum status , java.lang.String fieldName ) { java.util.ArrayList < java.lang.String > values = null ; if ( ! ( ( values = mDictionary.get ( status ) ) != null ) ) { values = new java.util.ArrayList < java.lang.String > ( ) ; mDictionary.put ( status , values ) ; } if ( ! ( values.contains ( fieldName ) ) ) { values.add ( fieldName ) ; } }

Target:
public final void AddField ( java.lang.Enum < ? > status , java.lang.String fieldName ) { java.util.List < java.lang.String > values = null ; if ( ! ( ( values = mDictionary.get ( status ) ) != null ) ) { values = new java.util.ArrayList < java.lang.String > ( ) ; mDictionary.put ( status , values ) ; } if ( ! ( values.contains ( fieldName ) ) ) { values.add ( fieldName ) ; } }