auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.StorageDomain > findAllStorageDomainsBySharedStatus ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain i : items ) { if ( ( i.getStorageDomainSharedStatus ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.StorageDomain i ) { return ( i.getStorageDomainSharedStatus ( ) ) == status ; }
Source:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressDifferent ( ) { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration geoRepSessionConfig ) { return createIdParameterMapper ( geoRepSessionConfig.getId ( ) ) . addValue ( "config_key" , geoRepSessionConfig.getKey ( ) ) . addValue ( "config_value" , geoRepSessionConfig.getValue ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration geoRepSessionConfig ) { return createIdParameterMapper ( geoRepSessionConfig.getId ( ) ) . addValue ( "config_key" , geoRepSessionConfig.getKey ( ) ) . addValue ( "config_value" , geoRepSessionConfig.getValue ( ) ) . addValue ( "config_description" , geoRepSessionConfig.getDescription ( ) ) . addValue ( "config_possible_values" , geoRepSessionConfig.getAllowedValues ( ) ) ; }
Source:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( macPoolDaoMock.getDcUsageCount ( org.mockito.Matchers.eq ( macPool.getId ( ) ) ) ) . thenReturn ( 0 ) ; final org.ovirt.engine.core.bll.ValidationResult validationResult = new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . notRemovingUsedPool ( ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testMacPoolExistsEntityDoesExist ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( macPoolValidator.macPoolExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume ) { boolean eligible = ( nonNullSlaveSizePredicate.eval ( slaveVolume ) ) && ( nonNullMasterSizePredicate.eval ( masterVolume ) ) ; if ( eligible ) { eligible = ( slaveVolume.getAdvancedDetails ( ) . getCapacityInfo ( ) . getTotalSize ( ) ) >= ( masterVolume.getAdvancedDetails ( ) . getCapacityInfo ( ) . getTotalSize ( ) ) ; } return eligible ; }

Target:
public boolean test ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume ) { boolean eligible = ( nonNullSlaveSizePredicate.test ( slaveVolume ) ) && ( nonNullMasterSizePredicate.test ( masterVolume ) ) ; if ( eligible ) { eligible = ( slaveVolume.getAdvancedDetails ( ) . getCapacityInfo ( ) . getTotalSize ( ) ) >= ( masterVolume.getAdvancedDetails ( ) . getCapacityInfo ( ) . getTotalSize ( ) ) ; } return eligible ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM getEntity ( java.lang.Object object ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) ; }

Target:
private void addBadMacsValidationListener ( org.ovirt.engine.ui.uicommonweb.models.storage.RegisterVmModel model ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.register.RegisterVmData vmData : model.getEntities ( ) . getItems ( ) ) { vmData.getBadMacsExist ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { refreshEntityTable ( ) ; } } ) ; } }
Source:
static org.ovirt.engine.core.common.businessentities.VDSGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VDSGroup entity , int index ) { org.easymock.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getDescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.Cluster setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.Cluster entity , int index ) { org.easymock.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getDescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return entity ; }
Source:
public void testListFailure ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , org.ovirt.engine.api.restapi.resource.aaa.FAILURE ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae ) ; } }

Target:
public void testListFailure ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.QUERY , org.ovirt.engine.api.restapi.resource.aaa.FAILURE ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) ) ; }
Source:
private void initSorting ( ) { nameColumn.makeSortable ( ) ; clusterColumn.makeSortable ( ) ; dcColumn.makeSortable ( ) ; speedColumn.makeSortable ( ) ; }

Target:
private void initSorting ( ) { hostStatus.makeSortable ( ) ; nameColumn.makeSortable ( ) ; clusterColumn.makeSortable ( ) ; dcColumn.makeSortable ( ) ; nicStatusColumn.makeSortable ( new org.ovirt.engine.ui.common.widget.table.column.SimpleStatusColumnComparator < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > ( nicStatusColumn ) ) ; speedColumn.makeSortable ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType parse ( java.lang.CharSequence text ) throws java.text.ParseException { return null ; }

Target:
private void initEditors ( ) { volumeTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType > ( ) ) ; forceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; serverEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.VDS > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return vds.getHostName ( ) ; } } ) ; }
Source:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Arrays.asList ( vlanNetwork , vmNetwork1 , nonVmNetwork1 ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( vmNetwork1.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = java.util.Arrays.asList ( networkAttachment ) ; expectedException.expect ( java.lang.IllegalArgumentException.class ) ; new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap ) . validateNetworkExclusiveOnNics ( ) ; }

Target:
public void testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( vmNetwork1.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = java.util.Collections.singletonList ( networkAttachment ) ; new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap , networkExclusivenessValidator ) . validateNetworkExclusiveOnNics ( ) ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public void testCreatingBusinessEntityMapWithDuplicatesAmongName ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem first = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem second = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Arrays.asList ( first , second ) ) ; }

Target:
public void testCreatingBusinessEntityMapWithDuplicatesAmongIds ( ) { org.ovirt.engine.core.compat.Guid itemId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem first = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( itemId , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem second = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( itemId , "different name" ) ; org.junit.jupiter.api.Assertions.assertThrows ( java.lang.IllegalArgumentException.class , ( ) -> new org.ovirt.engine.core.common.businessentities.BusinessEntityMap < > ( java.util.Arrays.asList ( first , second ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( getParameters ( ) . getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getParameters ( ) . getQuotaId ( ) , org.ovirt.engine.core.common.VdcObjectType.Quota , getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
public void testUpdateBrickStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterBrickStatus.UP , existingBrick.getStatus ( ) ) ; dao.updateBrickStatus ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID , GlusterBrickStatus.DOWN ) ; existingBrick = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterBrickStatus.DOWN , existingBrick.getStatus ( ) ) ; }

Target:
public void testUpdateBrickStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterStatus.UP , existingBrick.getStatus ( ) ) ; dao.updateBrickStatus ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID , GlusterStatus.DOWN ) ; existingBrick = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_BRICK_ID ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( GlusterStatus.DOWN , existingBrick.getStatus ( ) ) ; }
Source:
public static void getAAAProfilesListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAAProfilesListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.convertAAAProfilesResult ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.util.Collections.emptyList ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
private void addPermissionOnNetwork ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( VdcObjectType.Network ) ; perms.setObjectId ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissions ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getCurrentUser ( ) . getUserId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }
Source:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = macPoolFactory.createMacPool ( macPool ) ; macPools.put ( macPool.getId ( ) , poolForScope ) ; return poolForScope ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.debug ( "Creating new MacPool {}." , macPool ) ; org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = macPoolFactory.createMacPool ( macPool ) ; macPools.put ( macPool.getId ( ) , poolForScope ) ; return poolForScope ; }
Source:
public void test3 ( ) throws java.lang.Exception { java.lang.String password = "password" ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.uutils.crypto.EnvelopePBE.encode ( "PBKDF2WithHmacSHA1" , 256 , 4000 , null , password ) . equals ( org.ovirt.engine.core.uutils.crypto.EnvelopePBE.encode ( "PBKDF2WithHmacSHA1" , 256 , 4000 , null , password ) ) ) ; }

Target:
public void test3 ( ) throws java.lang.Exception { java.lang.String password = "password" ; org.junit.Assert.assertNotEquals ( org.ovirt.engine.core.uutils.crypto.EnvelopePBE.encode ( "PBKDF2WithHmacSHA1" , 256 , 4000 , null , password ) , org.ovirt.engine.core.uutils.crypto.EnvelopePBE.encode ( "PBKDF2WithHmacSHA1" , 256 , 4000 , null , password ) ) ; }
Source:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public int setTabIndexes ( int nextTabIndex ) { nameEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; descriptionEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; clusterEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; quotaEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; nextTabIndex = disksAllocationView.setTabIndexes ( nextTabIndex ) ; isTemplatePublicEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; return nextTabIndex ; }

Target:
public int setTabIndexes ( int nextTabIndex ) { nameEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; descriptionEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; clusterEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; quotaEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; nextTabIndex = disksAllocationView.setTabIndexes ( nextTabIndex ) ; isTemplatePublicEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; copyVmPermissions.setTabIndex ( ( nextTabIndex ++ ) ) ; return nextTabIndex ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.utils.PairQueryable ) ) { return false ; } org.ovirt.engine.core.common.utils.PairQueryable other = ( ( org.ovirt.engine.core.common.utils.PairQueryable ) ( obj ) ) ; if ( ! ( getPair ( ) . equals ( other.getPair ( ) ) ) ) { return false ; } return true ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.utils.PairQueryable ) ) { return false ; } org.ovirt.engine.core.common.utils.PairQueryable other = ( ( org.ovirt.engine.core.common.utils.PairQueryable ) ( obj ) ) ; return java.util.Objects.equals ( pair , other.pair ) ; }
Source:
public void showStatus ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity statusEntity ) { super . showStatus ( statusEntity ) ; getStopRemoveBricksCommand ( ) . setIsExecutionAllowed ( ( ( statusEntity.getStatusSummary ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) ) ; getCommitRemoveBricksCommand ( ) . setIsExecutionAllowed ( ( ( statusEntity.getStatusSummary ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ) ) ) ; }

Target:
public void showStatus ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity statusEntity ) { super . showStatus ( statusEntity ) ; getStopRemoveBricksCommand ( ) . setIsExecutionAllowed ( ( ( statusEntity.getStatusSummary ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) ) ; getCommitRemoveBricksCommand ( ) . setIsExecutionAllowed ( ( ( statusEntity.getStatusSummary ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ) ) ) ; getRetainBricksCommand ( ) . setIsExecutionAllowed ( ( ( statusEntity.getStatusSummary ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ) ) ) ; }
Source:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object loadedCluster ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithClusterEntityModel newItem = new org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithClusterEntityModel ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( loadedDataCenter ) ) , ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( loadedCluster ) ) ) ; unitModel.getDataCenterWithClustersList ( ) . setItems ( java.util.Arrays.asList ( newItem ) ) ; unitModel.getDataCenterWithClustersList ( ) . setSelectedItem ( newItem ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object loadedCluster ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster newItem = new org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( loadedDataCenter ) ) , ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( loadedCluster ) ) ) ; unitModel.getDataCenterWithClustersList ( ) . setItems ( java.util.Arrays.asList ( newItem ) ) ; unitModel.getDataCenterWithClustersList ( ) . setSelectedItem ( newItem ) ; }
Source:
public org.ovirt.engine.core.compat.Guid eval ( org.ovirt.engine.core.common.businessentities.storage.Disk a ) { return a.getId ( ) ; }

Target:
protected java.lang.String buildMetadataDictionaryForVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > > metaDictionary , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allVmImages ) { java.lang.String vmMeta = generateVmMetadata ( vm , allVmImages ) ; metaDictionary.put ( vm.getId ( ) , new org.ovirt.engine.core.compat.KeyValuePairCompat ( vmMeta , vm.getDiskMap ( ) . values ( ) . stream ( ) . map ( BaseDisk :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ) ; return vmMeta ; }
Source:
public void testGetVolumesByStatusTypesAndOption ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusTypesAndOption ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_KEY_NFS_DISABLE , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_VALUE_OFF ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.Assert.assertTrue ( ( ( volume.isNfsEnabled ( ) ) && ( ( volume.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTED_REPLICATE ) ) ) ) ; } }

Target:
public void testGetVolumesByStatusTypesAndOption ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusTypesAndOption ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_KEY_NFS_DISABLE , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_VALUE_OFF ) ; org.junit.jupiter.api.Assertions.assertNotNull ( volumes ) ; org.junit.jupiter.api.Assertions.assertTrue ( volumes.contains ( existingReplVol ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.jupiter.api.Assertions.assertTrue ( ( ( volume.isNfsEnabled ( ) ) && ( ( volume.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTED_REPLICATE ) ) ) ) ; } }
Source:
private void doFetchPrincipalRecord ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { java.lang.String principal = input.< org.ovirt.engine.api.extensions.ExtMap > get ( Authn.InvokeKeys.AUTH_RECORD ) . get ( Authn.AuthRecord.PRINCIPAL ) ; if ( principal.equals ( adminUser.< java.lang.String > get ( Authz.PrincipalRecord.NAME ) ) ) { output.put ( Authz.InvokeKeys.PRINCIPAL_RECORD , adminUser ) ; } }

Target:
private void doFetchPrincipalRecord ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { org.ovirt.engine.api.extensions.ExtMap authRecord = input.< org.ovirt.engine.api.extensions.ExtMap > get ( Authn.InvokeKeys.AUTH_RECORD ) ; java.lang.String principal = ( authRecord != null ) ? authRecord.< java.lang.String > get ( Authn.AuthRecord.PRINCIPAL ) : input.< java.lang.String > get ( Authz.InvokeKeys.PRINCIPAL ) ; if ( principal.equals ( adminUser.< java.lang.String > get ( Authz.PrincipalRecord.NAME ) ) ) { output.put ( Authz.InvokeKeys.PRINCIPAL_RECORD , adminUser ) ; } }
Source:
public void run ( ) { _threadMain ( ) ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { if ( ( _resultError ) || ( ! ( _installIncomplete ) ) ) { _parser.cliNoop ( ) ; } else { java.lang.String [ ] msgs = ( ( java.lang.String [ ] ) ( _parser.cliEnvironmentGet ( org.ovirt.ovirt_host_deploy.constants.CoreEnv.INSTALL_INCOMPLETE_REASONS ) ) ) ; userVisibleLog ( java.util.logging.Level.WARNING , "Installation is incomplete, manual intervention is required" ) ; for ( java.lang.String m : msgs ) { userVisibleLog ( java.util.logging.Level.WARNING , m ) ; } } return true ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.v3.types.V3NIC nic ) { return adaptAdd ( delegate :: add , nic ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.v3.types.V3NIC v3Nic ) { org.ovirt.engine.api.model.Nic v4Nic = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Nic ) ; org.ovirt.engine.api.v3.helpers.V3NICHelper.setVnicProfile ( vmId , v3Nic , v4Nic ) ; try { return adaptResponse ( delegate.add ( v4Nic ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }
Source:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > list = org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > list = org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . remove ( iface.getId ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( ( permsList ) == null ) && ( ( disk ) != null ) ) { permsList = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; permsList.add ( new org.ovirt.engine.core.common.PermissionSubject ( disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_DISK ) ) ; } return permsList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( ( permsList ) == null ) && ( ( disk ) != null ) ) { permsList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_DISK ) ) ; } return permsList ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.network.vm.ReorderVmNicsCommand.getVm ( ) ; if ( ( vm == null ) || ( ( vm.getStaticData ( ) ) == null ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.network.vm.ReorderVmNicsCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.network.vm.ReorderVmNicsCommand.getVm ( ) ; if ( ( vm == null ) || ( ( vm.getStaticData ( ) ) == null ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.network.vm.ReorderVmNicsCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getEntityWithDetails ( int index ) { return setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity.class ) , index , true ) ; }

Target:
private void setUpGetEntityExpectationsAllContent ( int times , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( times , notFound ) ; java.util.List < java.lang.String > populateValue = new java.util.ArrayList < java.lang.String > ( ) ; populateValue.add ( "true" ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( AbstractBackendResource.POPULATE ) ) . andReturn ( populateValue ) . anyTimes ( ) ; setupParentPopulateExpectations ( notFound ) ; }
Source:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( Ipv4BootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setNetworkName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; iface.setBridged ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ) ; iface.setMtu ( 100 ) ; iface.setVlanId ( 100 ) ; return iface ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setNetworkName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; iface.setBridged ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ) ; iface.setMtu ( 100 ) ; iface.setVlanId ( 100 ) ; iface.setQos ( createQos ( ) ) ; return iface ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { setTitle ( value.getComment ( ) ) ; if ( ( ( value.getComment ( ) ) != null ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn.getApplicationResources ( ) . commentImage ( ) ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { setTitle ( value.getComment ( ) ) ; if ( ( ( value.getComment ( ) ) != null ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn.resources.commentImage ( ) ; } return null ; }
Source:
private java.lang.String getManagementAgent ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String agent = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { agent = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( _vds.getpm_type ( ) ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { agent = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( _vds.getPmSecondaryType ( ) ) ; } return agent ; }

Target:
private java.lang.String getManagementAgent ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String agent = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { agent = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( _vds.getPmType ( ) ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { agent = org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( _vds.getPmSecondaryType ( ) ) ; } return agent ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { cancel ( ) ; } }

Target:
public void onSuccess ( java.lang.Boolean isNameUnique ) { if ( ! isNameUnique ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel VmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; VmModel.getInvalidityReasons ( ) . clear ( ) ; VmModel.getName ( ) . getInvalidityReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . nameMustBeUniqueInvalidReason ( ) ) ; VmModel.getName ( ) . setIsValid ( false ) ; VmModel.setIsValid ( false ) ; VmModel.fireValidationCompleteEvent ( ) ; } else { postNameUniqueCheck ( ) ; } }
Source:
public void testWithNoLists ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volDetailsEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ( ) ; volDetailsEntity.setBrickDetails ( getBrickDetails ( 0 , 0 , 0 ) ) ; org.ovirt.engine.api.model.GlusterBrickAdvancedDetails model = org.ovirt.engine.api.restapi.types.GlusterBrickDetailMapper.map ( volDetailsEntity , null ) ; assertNotNull ( model ) ; assertNull ( model.getGlusterClients ( ) ) ; assertNull ( model.getMntOptions ( ) ) ; }

Target:
public void testWithNoLists ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volDetailsEntity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ( ) ; volDetailsEntity.setBrickDetails ( getBrickDetails ( 0 , 0 , 0 ) ) ; org.ovirt.engine.api.model.GlusterBrickAdvancedDetails model = org.ovirt.engine.api.restapi.types.GlusterBrickDetailMapper.map ( volDetailsEntity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertNull ( model.getGlusterClients ( ) ) ; org.junit.Assert.assertNull ( model.getMntOptions ( ) ) ; }
Source:
public void testGetAllForHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > result = dao.getAllForHost ( existingVds.getHostName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsStatic vds : result ) { org.junit.Assert.assertEquals ( existingVds.getHostName ( ) , vds.getHostName ( ) ) ; } }

Target:
public void testGetByHostName ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = dao.getByHostName ( existingVds.getHostName ( ) ) ; org.junit.Assert.assertNotNull ( vds ) ; org.junit.Assert.assertEquals ( existingVds.getHostName ( ) , vds.getHostName ( ) ) ; }