auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static org.ovirt.engine.api.model.User map ( org.ovirt.engine.core.aaa.DirectoryUser entity , org.ovirt.engine.api.model.User template ) { org.ovirt.engine.api.model.User model = ( template != null ) ? template : new org.ovirt.engine.api.model.User ( ) ; model.setName ( entity.getFirstName ( ) ) ; model.setUserName ( ( ( ( entity.getName ( ) ) + "@" ) + ( entity.getDirectoryName ( ) ) ) ) ; model.setId ( org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.encode ( entity.getId ( ) ) ) ; model.setLastName ( entity.getLastName ( ) ) ; model.setEmail ( entity.getEmail ( ) ) ; model.setDepartment ( entity.getDepartment ( ) ) ; model.setNamespace ( entity.getNamespace ( ) ) ; if ( ( entity.getGroups ( ) ) != null ) { model.setGroups ( new org.ovirt.engine.api.model.Groups ( ) ) ; for ( org.ovirt.engine.core.aaa.DirectoryGroup directoryGroup : entity.getGroups ( ) ) { org.ovirt.engine.api.model.Group group = new org.ovirt.engine.api.model.Group ( ) ; group.setName ( directoryGroup.getName ( ) ) ; model.getGroups ( ) . getGroups ( ) . add ( group ) ; } } if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getDirectoryName ( ) ) ) ) { org.ovirt.engine.api.model.Domain dom = new org.ovirt.engine.api.model.Domain ( ) ; dom.setId ( new org.ovirt.engine.core.compat.Guid ( entity.getDirectoryName ( ) . getBytes ( ) , true ) . toString ( ) ) ; model.setDomain ( dom ) ; } return model ; }

Target:
public static org.ovirt.engine.api.model.User map ( org.ovirt.engine.core.aaa.DirectoryUser entity , org.ovirt.engine.api.model.User template ) { org.ovirt.engine.api.model.User model = ( template != null ) ? template : new org.ovirt.engine.api.model.User ( ) ; model.setName ( entity.getFirstName ( ) ) ; model.setUserName ( ( ( ( entity.getName ( ) ) + "@" ) + ( entity.getDirectoryName ( ) ) ) ) ; model.setId ( org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.encode ( entity.getId ( ) ) ) ; model.setLastName ( entity.getLastName ( ) ) ; model.setEmail ( entity.getEmail ( ) ) ; model.setDepartment ( entity.getDepartment ( ) ) ; model.setNamespace ( entity.getNamespace ( ) ) ; if ( ( entity.getGroups ( ) ) != null ) { model.setGroups ( new org.ovirt.engine.api.model.Groups ( ) ) ; for ( org.ovirt.engine.core.aaa.DirectoryGroup directoryGroup : entity.getGroups ( ) ) { org.ovirt.engine.api.model.Group group = new org.ovirt.engine.api.model.Group ( ) ; group.setName ( directoryGroup.getName ( ) ) ; model.getGroups ( ) . getGroups ( ) . add ( group ) ; } } if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getDirectoryName ( ) ) ) ) { org.ovirt.engine.api.model.Domain dom = new org.ovirt.engine.api.model.Domain ( ) ; dom.setId ( new org.ovirt.engine.core.compat.Guid ( entity.getDirectoryName ( ) . getBytes ( java.nio.charset.Charset.forName ( "UTF-8" ) ) , true ) . toString ( ) ) ; model.setDomain ( dom ) ; } return model ; }
Source:
public static java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( dstDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }

Target:
public static java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( dstDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; runInternalAction ( VdcActionType.RemovePermission , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RemoveUserCommand.getExecutionContext ( ) ) ) ; } org.ovirt.engine.core.bll.RemoveUserCommand.getDbUserDAO ( ) . remove ( id ) ; org.ovirt.engine.core.bll.RemoveUserCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; runInternalActionWithTasksContext ( VdcActionType.RemovePermission , tempVar ) ; } org.ovirt.engine.core.bll.RemoveUserCommand.getDbUserDAO ( ) . remove ( id ) ; org.ovirt.engine.core.bll.RemoveUserCommand.setSucceeded ( true ) ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
private void mockGraphicsDevice ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vm.getId ( ) ) ; org.mockito.Mockito.when ( vmDeviceDAO.getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.setDbFacade ( dbFacade ) ; }
Source:
private void endCopyCollapseOperations ( org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setVmtGuid ( VmTemplateHandler.BlankVmTemplateId ) ; vm.setVmtName ( null ) ; org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = org.ovirt.engine.core.bll.ExportVmCommand.getDbFacade ( ) . getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.ExportVmCommand.getDbFacade ( ) . getSnapshotDao ( ) . getId ( vm.getId ( ) , SnapshotType.ACTIVE ) ) ; vm.setSnapshots ( java.util.Arrays.asList ( activeSnapshot ) ) ; updateCopyVmInSpm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) . getStoragePoolId ( ) , vm , org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getStorageDomainId ( ) ) ; }

Target:
private void endCopyCollapseOperations ( org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setVmtGuid ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ; vm.setVmtName ( null ) ; org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = org.ovirt.engine.core.bll.ExportVmCommand.getDbFacade ( ) . getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.ExportVmCommand.getDbFacade ( ) . getSnapshotDao ( ) . getId ( vm.getId ( ) , SnapshotType.ACTIVE ) ) ; vm.setSnapshots ( java.util.Arrays.asList ( activeSnapshot ) ) ; updateCopyVmInSpm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) . getStoragePoolId ( ) , vm , org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getStorageDomainId ( ) ) ; }
Source:
public void customPropertiesNoNetwork ( ) { mockExistingNetworks ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndAssertNoChanges ( helper ) ; }

Target:
public void customPropertiesNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
private void setUpEntityQueryExpectations ( org.ovirt.engine.core.common.queries.VdcQueryType query , java.lang.Class < ? extends org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryClass , java.lang.String [ ] queryNames , java.lang.Object [ ] queryValues , java.lang.Object queryReturn , int times ) { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( query , queryClass , queryNames , queryValues , queryReturn ) ; } }

Target:
private void setUpEntityQueryExpectations ( org.ovirt.engine.core.common.queries.QueryType query , java.lang.Class < ? extends org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryClass , java.lang.String [ ] queryNames , java.lang.Object [ ] queryValues , java.lang.Object queryReturn , int times ) { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( query , queryClass , queryNames , queryValues , queryReturn ) ; } }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > findGroupsByQuery ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.lang.String query ) { return org.ovirt.engine.core.aaa.AuthzUtils.queryGroups ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( query , Authz.QueryEntity.GROUP ) , false , false ) ; }

Target:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryGroupRecords ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.GROUP ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populateGroups ( extension , namespace , inputMap ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser entity = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setFirstName ( NAMES [ index ] ) ; entity.setGroupNames ( new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser entity = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setFirstName ( NAMES [ index ] ) ; entity.setGroupNames ( new java.util.LinkedList < java.lang.String > ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; return entity ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; this . allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; queryNetworkAttachments ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; this . existingNetworkAttachments = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ) ( returnValue2 ) ) ; queryVfsConfig ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.Network getNetworkByVnicProfileId ( org.ovirt.engine.core.compat.Guid vnicProfileId ) { if ( vnicProfileId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.Network retVal = null ; org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) . get ( vnicProfileId ) ; if ( ( vnicProfile.getNetworkId ( ) ) != null ) { retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . get ( vnicProfile.getNetworkId ( ) ) ; } return retVal ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.Network getNetworkByVnicProfileId ( org.ovirt.engine.core.compat.Guid vnicProfileId ) { if ( vnicProfileId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) . get ( vnicProfileId ) ; return org.ovirt.engine.core.bll.network.cluster.NetworkHelper.getNetworkByVnicProfile ( vnicProfile ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkCluster getManagementNetworkCluster ( ) { if ( ( managementNetworkCluster ) == null ) { org.ovirt.engine.core.compat.Guid clusterId = networkCluster.getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.network.Network mgmt = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getByNameAndCluster ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) , clusterId ) ; managementNetworkCluster = getNetworkClusterDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( clusterId , mgmt.getId ( ) ) ) ; } return managementNetworkCluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkCluster getManagementNetworkCluster ( ) { if ( ( managementNetworkCluster ) == null ) { org.ovirt.engine.core.compat.Guid clusterId = networkCluster.getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.network.Network mgmt = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getByNameAndCluster ( org.ovirt.engine.core.utils.NetworkUtils.getDefaultManagementNetworkName ( ) , clusterId ) ; managementNetworkCluster = getNetworkClusterDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( clusterId , mgmt.getId ( ) ) ) ; } return managementNetworkCluster ; }
Source:
public void testNoDiskStatsDataForDisks ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; java.util.Map < java.lang.String , java.lang.Object > disk = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; disksStats.put ( "a" , disk ) ; disksStats.put ( "b" , disk ) ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xml = setDisksStatsInXmlRpc ( disksStats ) ; validateDisksStatsList ( getVds ( ) , xml , true ) ; }

Target:
public void testNoDiskStatsDataForDisks ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; java.util.Map < java.lang.String , java.lang.Object > disk = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; disksStats.put ( "a" , disk ) ; disksStats.put ( "b" , disk ) ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksStatsInXmlRpc ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) , xml , true ) ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( true , false ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( true , false ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; initAndAssertValidation ( true ) ; }
Source:
private void initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFencing ( ) ; processStoragePoolStatus ( ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , org.ovirt.engine.core.bll.InitVdsOnUpCommand.getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; } }

Target:
private boolean initVirtResources ( ) { if ( InitializeStorage ( ) ) { processFence ( ) ; processStoragePoolStatus ( ) ; } else { java.util.Map < java.lang.String , java.lang.String > customLogValues = java.util.Collections.singletonMap ( "StoragePoolName" , org.ovirt.engine.core.bll.InitVdsOnUpCommand.getStoragePoolName ( ) ) ; setNonOperational ( NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE , customLogValues ) ; return false ; } return true ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface object ) { return object.getNetworkName ( ) ; }

Target:
protected void initGeneralSubTabView ( ) { com.google.gwt.user.client.ui.ScrollPanel generalPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel , org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel getModel ( ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ) ( object.getDetailModels ( ) . get ( 0 ) ) ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportTemplateGeneralSubTabView ( modelProvider , constants ) ; generalPanel.add ( generalView ) ; subTabLayoutPanel.add ( generalPanel , constants.generalImpTempTab ( ) ) ; }
Source:
public org.ovirt.engine.api.resource.DomainGroupResource getDomainGroupSubResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendDomainGroupResource ( id , this ) ) ; }

Target:
public org.ovirt.engine.api.resource.DomainGroupResource getDomainGroupSubResource ( java.lang.String id ) { try { byte [ ] bytes = org.apache.commons.codec.binary.Hex.decodeHex ( id.toCharArray ( ) ) ; org.ovirt.engine.core.common.utils.ExternalId externalId = new org.ovirt.engine.core.common.utils.ExternalId ( bytes ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendDomainGroupResource ( externalId , this ) ) ; } catch ( org.apache.commons.codec.DecoderException exception ) { throw new org.ovirt.engine.api.restapi.resource.WebFaultException ( exception , ( ( "Can't decode domain group identifier '" + id ) + "'." ) , Response.Status.INTERNAL_SERVER_ERROR ) ; } }
Source:
private boolean isPmPrimarySelected ( ) { java.util.List items = ( ( java.util.List ) ( getPmVariants ( ) . getItems ( ) ) ) ; java.lang.String selectedItem = getPmVariants ( ) . getSelectedItem ( ) ; return ( items.indexOf ( selectedItem ) ) == 0 ; }

Target:
public void resetKernelCmdlineCheckboxes ( ) { final org.ovirt.engine.core.common.utils.CpuVendor cpuVendor = getCurrentCpuVendor ( ) ; if ( cpuVendor == null ) { return ; } switch ( cpuVendor ) { case INTEL : case AMD : setKernelCmdlineCheckboxesValue ( false ) ; break ; case IBM : setKernelCmdlineCheckboxesValue ( true ) ; break ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuVendor type: " + cpuVendor ) ) ; } updateKernelCmdlineCheckboxesChangeability ( ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( getVmName ( ) ) == null ? "" : getVmName ( ) ) ) ; jobProperties.put ( VdcObjectType.VdsGroups.name ( ) . toLowerCase ( ) , getVdsGroupName ( ) ) ; } return jobProperties ; }

Target:
protected void endSuccessfully ( ) { checkTrustedService ( ) ; endImportCommand ( ) ; }
Source:
public org.ovirt.engine.sdk.decorators.StorageDomain add ( org.ovirt.engine.sdk.decorators.StorageDomain storagedomain ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , storagedomain , org.ovirt.engine.sdk.entities.StorageDomain.class , org.ovirt.engine.sdk.decorators.StorageDomain.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.StorageDomain add ( org.ovirt.engine.sdk.decorators.StorageDomain storagedomain ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , storagedomain , org.ovirt.engine.sdk.entities.StorageDomain.class , org.ovirt.engine.sdk.decorators.StorageDomain.class , headers ) ; }
Source:
public void testConnection ( ) { chooseDcForCheckingIfGetNamesFromExternalProviderSupported ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( QueryType.GetVmsFromExternalProvider , buildGetVmsFromExternalProviderQueryParameters ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , retVal.getExceptionString ( ) ) ; } }

Target:
public void testConnection ( ) { chooseDcForCheckingIfGetNamesFromExternalProviderSupported ( ) ; org.ovirt.engine.core.common.queries.QueryReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( QueryType.GetVmsFromExternalProvider , buildGetVmsFromExternalProviderQueryParameters ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , retVal.getExceptionString ( ) ) ; } }
Source:
public void manage ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel manageModel = createManageList ( ) ; setWindow ( manageModel ) ; manageModel.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworkTitle ( ) ) ; manageModel.setHashName ( "assign_network" ) ; }

Target:
public void manage ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel manageModel = createManageList ( ) ; setWindow ( manageModel ) ; manageModel.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworkTitle ( ) ) ; manageModel.setHelpTag ( HelpTag.assign_network ) ; manageModel.setHashName ( "assign_network" ) ; }
Source:
private void setBasicMapValues ( org.quartz.JobDataMap data , java.lang.Object instance , java.lang.String methodName , java.lang.Class < ? > [ ] inputTypes , java.lang.Object [ ] inputParams ) { data.put ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.RUNNABLE_INSTANCE , instance ) ; data.put ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.RUN_METHOD_NAME , methodName ) ; data.put ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.RUN_METHOD_PARAM , inputParams ) ; data.put ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.RUN_METHOD_PARAM_TYPE , inputTypes ) ; }

Target:
private void setBasicMapValues ( org.quartz.JobDataMap data , java.lang.Object instance , java.lang.String methodName , java.lang.Class < ? > [ ] inputTypes , java.lang.Object [ ] inputParams ) { data.put ( org.ovirt.engine.core.utils.timer.RUNNABLE_INSTANCE , instance ) ; data.put ( org.ovirt.engine.core.utils.timer.RUN_METHOD_NAME , methodName ) ; data.put ( org.ovirt.engine.core.utils.timer.RUN_METHOD_PARAM , inputParams ) ; data.put ( org.ovirt.engine.core.utils.timer.RUN_METHOD_PARAM_TYPE , inputTypes ) ; }
Source:
void postConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . nioEngine = new org.ovirt.vdsm.jsonrpc.client.reactors.SSLEngineNioHelper ( channel , createSSLEngine ( true ) ) ; this . nioEngine.beginHandshake ( ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; reactor.wakeup ( ) ; key = this . channel.register ( selector , ( interestedOps |= java.nio.channels.SelectionKey.OP_WRITE ) , this ) ; } catch ( java.nio.channels.ClosedChannelException | javax.net.ssl.SSLException e ) { org.ovirt.vdsm.jsonrpc.client.reactors.SSLClient.log.error ( "Connection issues during ssl client creation" , e ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( e ) ; } }

Target:
protected void postConnect ( org.ovirt.vdsm.jsonrpc.client.utils.OneTimeCallback callback ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . nioEngine = new org.ovirt.vdsm.jsonrpc.client.reactors.SSLEngineNioHelper ( channel , createSSLEngine ( this . client ) , callback ) ; this . nioEngine.beginHandshake ( ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; reactor.wakeup ( ) ; key = this . channel.register ( selector , ( interestedOps |= java.nio.channels.SelectionKey.OP_WRITE ) , this ) ; } catch ( java.nio.channels.ClosedChannelException | javax.net.ssl.SSLException e ) { org.ovirt.vdsm.jsonrpc.client.reactors.SSLClient.log.error ( "Connection issues during ssl client creation" , e ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( e ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , java.lang.Boolean isPlugged , java.lang.Boolean isReadOnly , java.lang.String address , boolean isUsingScsiReservation ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , isPlugged , isReadOnly , address , null , isUsingScsiReservation ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , java.lang.Boolean isPlugged , java.lang.Boolean isReadOnly , boolean isUsingScsiReservation ) { return addDiskDevice ( vmId , deviceId , isPlugged , isReadOnly , "" , isUsingScsiReservation ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > getActionGroupsByRoleId ( org.ovirt.engine.core.compat.Guid roleId ) { java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > allGroups = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > allGroupsMaps = org.ovirt.engine.core.bll.RolesCommandBase.getRoleGroupMapDAO ( ) . getAllForRole ( roleId ) ; for ( org.ovirt.engine.core.common.businessentities.RoleGroupMap map : allGroupsMaps ) { allGroups.add ( map.getActionGroup ( ) ) ; } return allGroups ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > getActionGroupsByRoleId ( org.ovirt.engine.core.compat.Guid roleId ) { java.util.List < org.ovirt.engine.core.common.businessentities.ActionGroup > allGroups = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.RoleGroupMap > allGroupsMaps = org.ovirt.engine.core.bll.RolesCommandBase.getRoleGroupMapDao ( ) . getAllForRole ( roleId ) ; for ( org.ovirt.engine.core.common.businessentities.RoleGroupMap map : allGroupsMaps ) { allGroups.add ( map.getActionGroup ( ) ) ; } return allGroups ; }
Source:
public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getIscsiBondDao ( ) . save ( iscsiBond ) ; for ( org.ovirt.engine.core.compat.Guid networkId : iscsiBond.getNetworkIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addNetworkToIscsiBond ( iscsiBond.getId ( ) , networkId ) ; } for ( java.lang.String connectionId : iscsiBond.getStorageConnectionIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addStorageConnectionToIscsiBond ( iscsiBond.getId ( ) , connectionId ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getIscsiBondDao ( ) . save ( iscsiBond ) ; for ( org.ovirt.engine.core.compat.Guid networkId : iscsiBond.getNetworkIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addNetworkToIscsiBond ( iscsiBond.getId ( ) , networkId ) ; } for ( java.lang.String connectionId : iscsiBond.getStorageConnectionIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addStorageConnectionToIscsiBond ( iscsiBond.getId ( ) , connectionId ) ; } getReturnValue ( ) . setActionReturnValue ( iscsiBond.getId ( ) ) ; return null ; }
Source:
public void canDoActionFailure ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST ) ; }

Target:
public void canDoActionFailure ( ) { org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isConnectionForISCSIDomainAttached ( domain ) ) . thenReturn ( java.lang.Boolean.FALSE ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_NOT_EXIST ) ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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 ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public 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 , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVnicProfileDao ( ) ; vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vnicProfile.setName ( "new_profile" ) ; vnicProfile.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; vnicProfile.setNetworkQosId ( FixturesTool.NETWORK_QOS ) ; vnicProfile.setPortMirroring ( false ) ; vnicProfile.setPassthrough ( false ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVnicProfileDao ( ) ; vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vnicProfile.setName ( "new_profile" ) ; vnicProfile.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; vnicProfile.setNetworkQosId ( FixturesTool.NETWORK_QOS ) ; vnicProfile.setPortMirroring ( false ) ; vnicProfile.setPassthrough ( false ) ; vnicProfile.setNetworkFilterId ( FixturesTool.VNIC_PROFILE_NETWORK_FILTER ) ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( ( isShareableDiskEnabled && ( ( getVm ( ) ) != null ) ) && ( getVm ( ) . isDown ( ) ) ) ) ; }

Target:
public boolean getIsFloating ( ) { return ( getVm ( ) ) == null ; }
Source:
public boolean isNumOfSocketsCorrect ( int totalCpuCores ) { boolean isNumOfVcpusCorrect = ( ( extractIntFromListModel ( getModel ( ) . getCoresPerSocket ( ) ) ) * ( extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ) ) == totalCpuCores ; return isNumOfVcpusCorrect ; }

Target:
public boolean isNumOfSocketsCorrect ( int totalCpuCores ) { int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; int coresPerSocket = extractIntFromListModel ( getModel ( ) . getCoresPerSocket ( ) ) ; int threadsPerCore = extractIntFromListModel ( getModel ( ) . getThreadsPerCore ( ) ) ; return totalCpuCores == ( ( coresPerSocket * numOfSockets ) * threadsPerCore ) ; }
Source:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static 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:
private void runOnce ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( vm , getCustomPropertiesKeysList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( model ) ; model.init ( ) ; }

Target:
private void edit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; if ( vm == null ) { return ; } if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.frontend.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { vmInitLoaded ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( result ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getVmById ( getVmInitQuery , vm.getId ( ) ) ; }
Source:
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 > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageDao ( ) . get ( parameters.getImageId ( ) ) ; if ( diskImage != null ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DISK_LIVE_STORAGE_MIGRATION ) ) ; } } 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 > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageDao ( ) . get ( parameters.getImageId ( ) ) ; if ( diskImage != null ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DISK_LIVE_STORAGE_MIGRATION ) ) ; } } return permissionList ; }
Source:
public void testGetAllForHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > result = dao.getAllForHost ( existingVds.gethost_name ( ) ) ; 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.gethost_name ( ) , vds.gethost_name ( ) ) ; } }

Target:
public void testGetByName ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic result = dao.get ( existingVds.getVdsName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingVds.getVdsName ( ) , result.getVdsName ( ) ) ; }