auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageVmListModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageVmListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; vmModel.setItems ( vms ) ; vmModel.setIsEmpty ( ( ( vms.size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; setItems ( vms ) ; setIsEmpty ( ( ( vms.size ( ) ) == 0 ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; params = getQueryParameters ( ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDao ( ) ) . thenReturn ( vmDao ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( domainId ) ; query = getQuery ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( domainId ) ; query = getQuery ( ) ; }
Source:
public void testLongMessageSave ( ) { char [ ] fill = new char [ ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxAuditLogMessageLength ) ) + 1 ] ; java.util.Arrays.fill ( fill , '0' ) ; newAuditLog.setaudit_log_id ( 45000 ) ; newAuditLog.setmessage ( new java.lang.String ( fill ) ) ; dao.save ( newAuditLog ) ; org.ovirt.engine.core.common.businessentities.AuditLog result = dao.get ( newAuditLog.getaudit_log_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.getmessage ( ) . endsWith ( "..." ) ) ; }

Target:
public void testLongMessageSave ( ) { char [ ] fill = new char [ ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxAuditLogMessageLength ) ) + 1 ] ; java.util.Arrays.fill ( fill , '0' ) ; newAuditLog.setaudit_log_id ( 45000 ) ; newAuditLog.setmessage ( new java.lang.String ( fill ) ) ; dao.save ( newAuditLog ) ; org.ovirt.engine.core.common.businessentities.AuditLog result = dao.get ( newAuditLog.getaudit_log_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.getmessage ( ) . endsWith ( "..." ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; mockVMDao ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; mockVMDao ( vm ) ; return vm ; }
Source:
private static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( "Key '{}' is not translated in '{}'" , key , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ; return null ; } }

Target:
protected static java.lang.String getMessageOrNull ( org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resourceBundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( "Key '{}' is not translated in '{}'" , key , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getResourceBundleName ( ) ) ; return null ; } }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > setUpStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.storage_pool entity = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplatesResourceTest.DATA_CENTER_ID ) ; return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) { private static final long serialVersionUID = 6544998068993726769L ; { add ( entity ) ; } } ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > setUpStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool entity = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplatesResourceTest.DATA_CENTER_ID ) ; return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) { private static final long serialVersionUID = 6544998068993726769L ; { add ( entity ) ; } } ; }
Source:
protected void initSelectedNetwork ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { for ( org.ovirt.engine.core.common.businessentities.network.Network a : networks ) { java.lang.String networkName = ( a == null ) ? null : a.getname ( ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( networkName , getNic ( ) . getNetworkName ( ) ) ) { getNetwork ( ) . setSelectedItem ( a ) ; return ; } } if ( ( getNic ( ) . getNetworkName ( ) ) == null ) { getNetwork ( ) . setSelectedItem ( null ) ; } }

Target:
protected void initSelectedNetwork ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { for ( org.ovirt.engine.core.common.businessentities.network.Network a : networks ) { java.lang.String networkName = ( a == null ) ? null : a.getName ( ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( networkName , getNic ( ) . getNetworkName ( ) ) ) { getNetwork ( ) . setSelectedItem ( a ) ; return ; } } if ( ( getNic ( ) . getNetworkName ( ) ) == null ) { getNetwork ( ) . setSelectedItem ( null ) ; } }
Source:
private java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > getIdsOfNetworkAttachmentsRelatedToInterfaceNames ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : networkAttachments ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( attachment.getNicName ( ) , attachment.getId ( ) , map , new org.ovirt.engine.core.utils.collections.MultiValueMapUtils.ListCreator < org.ovirt.engine.core.compat.Guid > ( ) ) ; } return map ; }

Target:
private java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > getIdsOfNetworkAttachmentsRelatedToInterfaceNames ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : networkAttachments ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( attachment.getNicName ( ) , attachment.getId ( ) , map , new org.ovirt.engine.core.utils.collections.MultiValueMapUtils.ListCreator ( ) ) ; } return map ; }
Source:
public void dataCenterVersionMatches ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( dataCenter ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.dataCenterVersionMismatch ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void dataCenterVersionMatches ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( dataCenter ) ; org.junit.Assert.assertThat ( validator.dataCenterVersionMismatch ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand command ) { org.mockito.Mockito.doReturn ( serverServiceDao ) . when ( command ) . getGlusterServerServiceDao ( ) ; org.mockito.Mockito.doReturn ( serviceDao ) . when ( command ) . getGlusterServiceDao ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontend ) . when ( command ) . getVdsBroker ( ) ; org.mockito.Mockito.doReturn ( getUpServers ( ) ) . when ( glusterUtils ) . getAllUpServers ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand command ) { org.mockito.Mockito.doReturn ( serverServiceDao ) . when ( command ) . getGlusterServerServiceDao ( ) ; org.mockito.Mockito.doReturn ( serviceDao ) . when ( command ) . getGlusterServiceDao ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.doReturn ( getUpServers ( ) ) . when ( glusterUtils ) . getAllUpServers ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
protected void buildVmBootSequence ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmId ( vm.getId ( ) ) ; java.lang.String bootSeqInDB = org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.getBootSequence ( devices ) . toString ( ) . toLowerCase ( ) ; java.lang.String bootSeqInBE = vm.getBootSequence ( ) . toString ( ) . toLowerCase ( ) ; if ( bootSeqInBE.equals ( bootSeqInDB ) ) createInfo.add ( VdsProperties.Boot , bootSeqInDB ) ; else createInfo.add ( VdsProperties.Boot , bootSeqInBE ) ; }

Target:
protected void buildVmBootSequence ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmId ( vm.getId ( ) ) ; java.lang.String bootSeqInDB = org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.getBootSequence ( devices ) . toString ( ) . toLowerCase ( ) ; java.lang.String bootSeqInBE = vm.getBootSequence ( ) . toString ( ) . toLowerCase ( ) ; if ( bootSeqInBE.equals ( bootSeqInDB ) ) createInfo.put ( VdsProperties.Boot , bootSeqInDB ) ; else createInfo.put ( VdsProperties.Boot , bootSeqInBE ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddNetwork" ) ) { AddNetwork ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { AddDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnAddDisk" ) ) { OnAddDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddNetwork" ) ) { AddNetwork ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "AddDisk" ) ) { AddDisk ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }
Source:
void showModels ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > interfaceLineModels ) { this . setVisible ( true ) ; grid.resizeRows ( interfaceLineModels.size ( ) ) ; int row = 0 ; for ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModel : interfaceLineModels ) { setGridWidget ( row , 0 , createInterfacePanel ( lineModel ) ) ; setGridWidget ( row , 1 , createBondPanel ( lineModel ) ) ; setGridWidget ( row , 2 , createVLanPanel ( lineModel ) ) ; setGridWidget ( row , 3 , createStatisticsPanel ( lineModel ) ) ; row ++ ; } }

Target:
void showModels ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > interfaceLineModels , org.ovirt.engine.core.common.businessentities.VDS vds ) { this . setVisible ( true ) ; grid.resizeRows ( interfaceLineModels.size ( ) ) ; int row = 0 ; for ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModel : interfaceLineModels ) { setGridWidget ( row , 0 , createInterfacePanel ( lineModel ) ) ; setGridWidget ( row , 1 , createBondPanel ( lineModel , vds ) ) ; setGridWidget ( row , 2 , createVLanPanel ( lineModel ) ) ; setGridWidget ( row , 3 , createStatisticsPanel ( lineModel ) ) ; row ++ ; } }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getCompensationContext ( ) . snapshotEntity ( oldVmDevice ) ; getVmNicDao ( ) . update ( getInterface ( ) ) ; oldVmDevice.setCustomProperties ( getInterface ( ) . getCustomProperties ( ) ) ; getDbFacade ( ) . getVmDeviceDao ( ) . update ( oldVmDevice ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getVmNicDao ( ) . update ( getInterface ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.update ( getModel ( 1 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getModel ( 1 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public synchronized org.ovirt.vdsmfake.domain.DataCenter getDataCenterById ( java.lang.String id ) { org.ovirt.vdsmfake.domain.DataCenter dataCenter = null ; if ( dataCenterMap.containsKey ( id ) ) { return dataCenterMap.get ( id ) ; } dataCenter = ( ( org.ovirt.vdsmfake.domain.DataCenter ) ( loadObject ( org.ovirt.vdsmfake.domain.DataCenter.class , id ) ) ) ; if ( dataCenter == null ) { dataCenter = new org.ovirt.vdsmfake.domain.DataCenter ( ) ; dataCenter.setId ( id ) ; } else { org.ovirt.vdsmfake.domain.VdsmManager.log.info ( "Data center restored from file, id: {}" , id ) ; } dataCenterMap.put ( id , dataCenter ) ; return dataCenter ; }

Target:
public org.ovirt.vdsmfake.domain.DataCenter getDataCenterById ( java.lang.String id ) { org.ovirt.vdsmfake.domain.DataCenter dataCenter = null ; if ( dataCenterMap.containsKey ( id ) ) { return dataCenterMap.get ( id ) ; } dataCenter = ( ( org.ovirt.vdsmfake.domain.DataCenter ) ( loadObject ( org.ovirt.vdsmfake.domain.DataCenter.class , id ) ) ) ; if ( dataCenter == null ) { dataCenter = new org.ovirt.vdsmfake.domain.DataCenter ( ) ; dataCenter.setId ( id ) ; } else { org.ovirt.vdsmfake.domain.VdsmManager.log.info ( "Data center restored from file, id: {}" , id ) ; } dataCenterMap.put ( id , dataCenter ) ; return dataCenter ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__DETACH ) ; return canDetachDomain ( org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.getParameters ( ) . getDestroyingPool ( ) , org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.getParameters ( ) . getRemoveLast ( ) , org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.isInternalExecution ( ) ) ; }

Target:
protected boolean canDoAction ( ) { return canDetachDomain ( org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.getParameters ( ) . getDestroyingPool ( ) , org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.getParameters ( ) . getRemoveLast ( ) , org.ovirt.engine.core.bll.storage.DetachStorageDomainFromPoolCommand.isInternalExecution ( ) ) ; }
Source:
private void rollbackDisksQuota ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > quotaList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : imageTemplates ) { quotaList.add ( image.getQuotaId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getQuotaManager ( ) . rollbackQuota ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getStoragePool ( ) , quotaList ) ; }

Target:
private void rollbackDisksQuota ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > quotaList = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; if ( ( imageTemplates ) != null ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : imageTemplates ) { quotaList.add ( image.getQuotaId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getQuotaManager ( ) . rollbackQuota ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getStoragePool ( ) , quotaList ) ; } }
Source:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getRelevantDiskImage ( ) ; if ( ( diskImage != null ) && ( ( diskImage.getImageStatus ( ) ) != imageStatus ) ) { diskImage.setImageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }

Target:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { setImageStatus ( imageStatus , getRelevantDiskImage ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; filteredStorageDomains = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( org.ovirt.engine.ui.uicommonweb.Linq.isDataActiveStorageDomain ( domain ) ) { filteredStorageDomains.add ( domain ) ; } } if ( getClusterQuota ( ) . getIsAvailable ( ) ) { initQuotaForStorageDomains ( ) ; } else { initDisksStorageDomainsList ( ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { filteredStorageDomains = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( org.ovirt.engine.ui.uicommonweb.Linq.isDataActiveStorageDomain ( domain ) ) { filteredStorageDomains.add ( domain ) ; } } if ( getClusterQuota ( ) . getIsAvailable ( ) ) { initQuotaForStorageDomains ( ) ; } else { initDisksStorageDomainsList ( ) ; } }
Source:
public static org.ovirt.engine.core.aaa.DirectoryUser instantiate ( com.google.gwt.user.client.rpc.SerializationStreamReader reader ) throws com.google.gwt.user.client.rpc.SerializationException { java.lang.String directoryName = reader.readString ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = ( ( org.ovirt.engine.core.common.utils.ExternalId ) ( reader.readObject ( ) ) ) ; java.lang.String name = reader.readString ( ) ; return new org.ovirt.engine.core.aaa.DirectoryUser ( directoryName , id , name ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryUser instantiate ( com.google.gwt.user.client.rpc.SerializationStreamReader reader ) throws com.google.gwt.user.client.rpc.SerializationException { java.lang.String directoryName = reader.readString ( ) ; java.lang.String id = reader.readString ( ) ; java.lang.String name = reader.readString ( ) ; return new org.ovirt.engine.core.aaa.DirectoryUser ( directoryName , id , name ) ; }
Source:
public void testExecuteQuery ( ) { mcr.mockConfigValue ( ConfigValues.ProductRPMVersion , "11.1.12asdf." ) ; org.ovirt.engine.core.bll.GetProductVersionQuery < org.ovirt.engine.core.common.queries.QueryParametersBase > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.lang.Object returnValue = query.getQueryReturnValue ( ) . getReturnValue ( ) ; verifyVersionEqual ( returnValue , 11 , 1 , 12 ) ; }

Target:
public void testExecuteQuery ( ) { org.ovirt.engine.core.bll.GetProductVersionQuery < org.ovirt.engine.core.common.queries.QueryParametersBase > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.lang.Object returnValue = query.getQueryReturnValue ( ) . getReturnValue ( ) ; verifyVersionEqual ( returnValue , 11 , 1 , 12 ) ; }
Source:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > items = new java.util.ArrayList < java.lang.Object > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.storage_domains i = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( item ) ) ; items.add ( i.getId ( ) ) ; } return items.toArray ( new java.lang.Object [ ] { } ) ; } }

Target:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > items = new java.util.ArrayList < java.lang.Object > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain i = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( item ) ) ; items.add ( i.getId ( ) ) ; } return items.toArray ( new java.lang.Object [ ] { } ) ; } }
Source:
public void testIncompleteImport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.doImport ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "doImport" , "cluster.id|name" , "storageDomain.id|name" ) ; } }

Target:
public void testIncompleteImport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.doImport ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "doImport" , "storageDomain.id|name" ) ; } }
Source:
public static void initOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsNames ) , callback ) ; }

Target:
public static void initOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsIds ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsNames ) , callback ) ; }
Source:
private boolean isStorageFormatSupportedByStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool targetStoragePool = getTargetStoragePool ( ) ; if ( targetStoragePool == null ) { return false ; } java.util.Set < org.ovirt.engine.core.common.businessentities.StorageFormatType > supportedStorageFormats = getSupportedStorageFormatSet ( targetStoragePool.getcompatibility_version ( ) ) ; return supportedStorageFormats.contains ( storageFormat ) ; }

Target:
private boolean isStorageFormatSupportedByStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool targetStoragePool = getTargetStoragePool ( ) ; if ( targetStoragePool == null ) { return true ; } java.util.Set < org.ovirt.engine.core.common.businessentities.StorageFormatType > supportedStorageFormats = getSupportedStorageFormatSet ( targetStoragePool.getcompatibility_version ( ) ) ; return supportedStorageFormats.contains ( storageFormat ) ; }
Source:
public void onGridTimerStateChange ( org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent event ) { int newInterval = event.getRefreshRate ( ) ; if ( timer.isActive ( ) ) { if ( newInterval != ( timer.getRefreshRate ( ) ) ) { timer.stop ( ) ; timer.setRefreshRate ( newInterval ) ; timer.start ( ) ; } } else { timer.setRefreshRate ( newInterval ) ; } }

Target:
public void onGridTimerStateChange ( org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent event ) { int newInterval = event.getRefreshRate ( ) ; if ( timer.isActive ( ) ) { if ( newInterval != ( timer.getRefreshRate ( ) ) ) { timer.stop ( ) ; timer.setRefreshRate ( newInterval , false ) ; timer.start ( ) ; } } else { timer.setRefreshRate ( newInterval , false ) ; } }