auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addDiskAllocation ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( model.getStorageDomain ( ) . getItems ( ) ) ) ; if ( ! ( model.getIsDisksAvailable ( ) ) ) { return ; } disksAllocationView.edit ( model.getDisksAllocationModel ( ) ) ; model.getDisksAllocationModel ( ) . getStorageDomain ( ) . setItems ( model.getStorageDomain ( ) . getItems ( ) ) ; model.getDisksAllocationModel ( ) . setDisks ( model.getDisks ( ) ) ; }

Target:
private void addDiskAllocation ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { if ( ! ( model.getIsDisksAvailable ( ) ) ) { return ; } disksAllocationView.edit ( model.getDisksAllocationModel ( ) ) ; model.getDisksAllocationModel ( ) . getStorageDomain ( ) . setItems ( model.getStorageDomain ( ) . getItems ( ) ) ; model.getDisksAllocationModel ( ) . setDisks ( model.getDisks ( ) ) ; }
Source:
private java.util.List < java.lang.String > getSelectedConnections ( ) { java.util.List < java.lang.String > selectedConnections = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections conn : getStorageTargets ( ) . getSelectedItems ( ) ) { selectedConnections.add ( conn.getid ( ) ) ; } return selectedConnections ; }

Target:
private java.util.List < java.lang.String > getSelectedConnections ( ) { java.util.List < java.lang.String > selectedConnections = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections conn : getStorageTargets ( ) . getSelectedItems ( ) ) { selectedConnections.add ( conn.getId ( ) ) ; } return selectedConnections ; }
Source:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; baseIface = createBaseInterface ( null , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanIface = createVlanInterface ( baseIface , networkName , qosA ) ; setTestIface ( vlanIface ) ; mcr.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( vlanIface ) ) . thenReturn ( baseIface ) ; }

Target:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; baseIface = createBaseInterface ( null , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanIface = createVlanInterface ( baseIface , networkName , qosA ) ; setTestIface ( vlanIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( vlanIface ) ) . thenReturn ( baseIface ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportExportRepoImageBaseModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; model.getDataCenter ( ) . setItems ( dataCenters ) ; model.getDataCenter ( ) . setIsEmpty ( dataCenters.isEmpty ( ) ) ; model.updateControlsAvailability ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setIsEmpty ( dataCenters.isEmpty ( ) ) ; updateControlsAvailability ( ) ; stopProgress ( ) ; }
Source:
public void refreshGeoRepDataForVolume ( final org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { if ( volume == null ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.GlusterVolumeGeoRepSyncFailed , "No volume information" ) ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getClusterDao ( ) . get ( volume.getClusterId ( ) ) ; discoverGeoRepDataInCluster ( cluster , volume.getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > geoRepSessions = getGeoRepDao ( ) . getGeoRepSessions ( volume.getId ( ) ) ; refreshGeoRepSessionStatusForSessions ( cluster , geoRepSessions ) ; }

Target:
public void refreshGeoRepDataForVolume ( final org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { if ( volume == null ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.GlusterVolumeGeoRepSyncFailed , "No volume information" ) ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getClusterDao ( ) . get ( volume.getClusterId ( ) ) ; discoverGeoRepDataInCluster ( cluster , volume ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > geoRepSessions = getGeoRepDao ( ) . getGeoRepSessions ( volume.getId ( ) ) ; refreshGeoRepSessionStatusForSessions ( cluster , geoRepSessions ) ; }
Source:
public synchronized void registerFactory ( org.ovirt.engine.core.authentication.Factory < O > factory ) { java.util.HashMap < java.lang.String , org.ovirt.engine.core.authentication.Factory < O > > newFactories = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.authentication.Factory < O > > ( factoriesByType ) ; newFactories.put ( factory.getType ( ) , factory ) ; factoriesByType = newFactories ; }

Target:
public void registerFactory ( org.ovirt.engine.core.authentication.Factory < O > factory ) { factoriesByType.put ( factory.getType ( ) , factory ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { defaultType = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultNicType ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ) ( returnValue ) ) ) ; supportedInterfaceTypes = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getVmNicList ( getNicsQuery , vmId ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { defaultType = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultNicType ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ) ( returnValue ) ) ) ; supportedInterfaceTypes = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmNicList ( getNicsQuery , vmId ) ; }
Source:
public static void getAllVnicProfiles ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getAllVnicProfiles ( 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 ) { 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.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
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 ) ) ; allExistingNics = returnValue.getReturnValue ( ) ; existingVlanDevicesByVlanId = mapVlanDevicesByVlanId ( ) ; initCreateOrUpdateBondParameters ( ) ; initNicLabelsParameters ( ) ; queryNetworkAttachments ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { allExistingNics = returnValue.getReturnValue ( ) ; existingVlanDevicesByVlanId = mapVlanDevicesByVlanId ( ) ; initCreateOrUpdateBondParameters ( ) ; initNicLabelsParameters ( ) ; queryNetworkAttachments ( ) ; }
Source:
private void updateIsUsbEnabled ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isUSBEnabledByDefault ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { setIsUsbEnabled ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateIsUsbEnabled ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isUSBEnabledByDefault ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { setIsUsbEnabled ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ! ( pools.isEmpty ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
private void mockVdsDynamic ( ) { org.mockito.Mockito.when ( vdsDynamicDAO.get ( command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ) ; org.mockito.Mockito.when ( vdsDynamicDAO.getFromCache ( command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ) ; }

Target:
private void mockVdsDynamic ( ) { org.mockito.Mockito.when ( vdsDynamicDAO.get ( command.getParameters ( ) . getVdsId ( ) ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ) ; }
Source:
public static java.lang.String getDiskLabelList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks.isEmpty ( ) ) { return null ; } final java.util.List < java.lang.String > labels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { labels.add ( disk.getDiskAlias ( ) ) ; } return java.lang.String.join ( ", " , labels ) ; }

Target:
public static java.lang.String getDiskLabelList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks.isEmpty ( ) ) { return null ; } final java.util.List < java.lang.String > labels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { labels.add ( disk.getDiskAlias ( ) ) ; } return java.lang.String.join ( ", " , labels ) ; }
Source:
protected void onExportChanged ( ) { boolean externalNetwork = ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ; getExternalProviders ( ) . setIsChangable ( externalNetwork ) ; getNetworkLabel ( ) . setIsChangable ( externalNetwork ) ; getIsVmNetwork ( ) . setIsChangable ( ( ! externalNetwork ) ) ; getHasMtu ( ) . setIsChangable ( ( ! externalNetwork ) ) ; if ( externalNetwork ) { getIsVmNetwork ( ) . setEntity ( true ) ; getHasMtu ( ) . setEntity ( false ) ; } }

Target:
protected void onExportChanged ( ) { boolean externalNetwork = ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ; getExternalProviders ( ) . setIsChangable ( externalNetwork ) ; getIsVmNetwork ( ) . setIsChangable ( ( ! externalNetwork ) ) ; getHasMtu ( ) . setIsChangable ( ( ! externalNetwork ) ) ; if ( externalNetwork ) { getIsVmNetwork ( ) . setEntity ( true ) ; getHasMtu ( ) . setEntity ( false ) ; } super . onExportChanged ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > getAll ( final java.lang.String lunId ) { return org.ovirt.engine.core.utils.linq.LinqUtils.filter ( getAllLUNStorageServerConnection ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap a ) { return a.getLunId ( ) . equals ( lunId ) ; } } ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > getAll ( final java.lang.String lunId ) { return org.ovirt.engine.core.utils.linq.LinqUtils.filter ( getAll ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap a ) { return a.getLunId ( ) . equals ( lunId ) ; } } ) ; }
Source:
private static void setActions ( org.ovirt.engine.api.model.BaseResource model , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.api.restapi.util.LinkHelper.Collection collection = org.ovirt.engine.api.restapi.util.LinkHelper.getCollection ( model ) ; java.lang.String path = org.ovirt.engine.api.restapi.util.LinkHelper.getPath ( model , suggestedParentType ) ; if ( path != null ) { org.ovirt.engine.api.restapi.util.ActionsBuilder actionsBuilder = new org.ovirt.engine.api.restapi.util.ActionsBuilder ( path , collection.getResourceType ( ) ) ; model.setActions ( actionsBuilder.build ( ) ) ; } }

Target:
private static void setActions ( org.ovirt.engine.api.model.BaseResource model , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.api.restapi.util.LinkHelper.Collection collection = org.ovirt.engine.api.restapi.util.LinkHelper.getCollection ( model ) ; if ( collection != null ) { java.lang.String path = org.ovirt.engine.api.restapi.util.LinkHelper.getPath ( model , suggestedParentType ) ; if ( path != null ) { org.ovirt.engine.api.restapi.util.ActionsBuilder actionsBuilder = new org.ovirt.engine.api.restapi.util.ActionsBuilder ( path , collection.getResourceType ( ) ) ; model.setActions ( actionsBuilder.build ( ) ) ; } } }
Source:
private org.ovirt.engine.ui.uicommonweb.models.GridTimer getRefreshTimer ( ) { if ( ( refreshTimer ) == null ) { refreshTimer = new org.ovirt.engine.ui.uicommonweb.models.GridTimer ( "VmMonitorModel" , getEventBus ( ) ) { @ java.lang.Override public void execute ( ) { refresh ( ) ; } } ; refreshTimer.setRefreshRate ( 1000 ) ; } return refreshTimer ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.GridTimer getRefreshTimer ( ) { if ( ( refreshTimer ) == null ) { refreshTimer = new org.ovirt.engine.ui.uicommonweb.models.GridTimer ( "VmMonitorModel" ) { @ java.lang.Override public void execute ( ) { refresh ( ) ; } } ; refreshTimer.setRefreshRate ( 1000 ) ; } return refreshTimer ; }
Source:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { this . constants = constants ; initTableColumns ( ) ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; org.ovirt.engine.ui.common.widget.uicommon.vm.BaseVmDiskListModelTable.getModel ( ) . getItemsChangedEvent ( ) . 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 ) { disksViewRadioGroup.setDiskStorageType ( getModel ( ) . getDiskViewType ( ) . getEntity ( ) ) ; } } ) ; }

Target:
public void initTable ( ) { initTableColumns ( ) ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; org.ovirt.engine.ui.common.widget.uicommon.vm.BaseVmDiskListModelTable.getModel ( ) . getItemsChangedEvent ( ) . 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 ) { disksViewRadioGroup.setDiskStorageType ( getModel ( ) . getDiskViewType ( ) . getEntity ( ) ) ; } } ) ; }
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; }
Source:
private void setDefaultNames7 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getStorageDomainList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.storageList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; setDefaultNames8 ( ) ; } } , frontendHash ) ) ; }

Target:
private void setDefaultNames7 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getStorageDomainList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.storageList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; setDefaultNames8 ( ) ; } } , frontendHash ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.UpdateOptionsNonLocalFSData ( ) ; } else { model.UpdateOptionsLocalFSData ( ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.UpdateOptionsNonLocalFSData ( ) ; } else { model.UpdateOptionsLocalFSData ( ) ; } }
Source:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.translateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; org.junit.Assert.assertTrue ( "Size" , ( ( error.size ( ) ) == 1 ) ) ; org.junit.Assert.assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }

Target:
public void testStringSubstitutionWithList ( ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( org.ovirt.engine.core.utils.ErrorTranslatorTest.FILENAME ) ; java.util.List < java.lang.String > error = et.translateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_WITH_REPLACEMENT , "$action SOMEACTION" , "$type SOME Type" ) ) ; java.lang.String result = "Cannot SOMEACTION SOME Type. VM's Image doesn't exist." ; org.junit.Assert.assertEquals ( "Size" , 1 , error.size ( ) ) ; org.junit.Assert.assertEquals ( "String should equal" , result , error.get ( 0 ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskForVolumeInfo ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage ancestor = org.ovirt.engine.core.bll.ExportVmCommand.getDiskImageDao ( ) . getAncestor ( disk.getImageId ( ) ) ; if ( ancestor == null ) { log.warn ( "Can't find ancestor of Disk with ID '{}', using original disk for volume info." , disk.getImageId ( ) ) ; ancestor = disk ; } return ancestor ; } else { return disk ; } }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskForVolumeInfo ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { return org.ovirt.engine.core.bll.ExportVmCommand.getDiskImageDao ( ) . getAncestor ( disk.getImageId ( ) ) ; } else { return disk ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = super . getPermissionCheckSubjects ( ) ; if ( ( ( ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getParameters ( ) . getInterface ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getParameters ( ) . getInterface ( ) . isPortMirroring ( ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.common.businessentities.ActionGroup.PORT_MIRRORING ) ) ; } 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 = super . getPermissionCheckSubjects ( ) ; if ( ( ( ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getParameters ( ) . getInterface ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getParameters ( ) . getInterface ( ) . isPortMirroring ( ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.UpdateVmInterfaceCommand.getVm ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.common.businessentities.ActionGroup.PORT_MIRRORING ) ) ; } return permissionList ; }
Source:
public static java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , org.ovirt.engine.core.compat.Guid storagePoolId ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( windowsPath ) ) { return windowsPath ; } java.lang.String fileName = org.ovirt.engine.core.compat.backendcompat.Path.GetFileName ( windowsPath ) ; java.lang.String isoPrefix = ( ( java.lang.String ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.IsoPrefix , new org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters ( storagePoolId ) ) . getReturnValue ( ) ) ) ; return java.lang.String.format ( "%1$s/%2$s" , isoPrefix , fileName ) ; }

Target:
public static java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , java.lang.String isoPrefix ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( windowsPath ) ) { return windowsPath ; } java.lang.String fileName = org.ovirt.engine.core.compat.backendcompat.Path.GetFileName ( windowsPath ) ; return java.lang.String.format ( "%1$s/%2$s" , isoPrefix , fileName ) ; }
Source:
private void saveToDb ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { org.ovirt.engine.core.common.AuditLogSeverity severity = logType.getSeverity ( ) ; org.ovirt.engine.core.common.businessentities.AuditLog auditLog = createAuditLog ( auditLogable , logType , loggerString , severity ) ; if ( auditLog == null ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( "Unable to create AuditLog" ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.setPropertiesFromAuditLogableBase ( auditLogable , auditLog ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getDbFacadeInstance ( ) . getAuditLogDao ( ) . save ( auditLog ) ; logMessage ( severity , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageToLog ( loggerString , auditLog ) ) ; } }

Target:
private void saveToDb ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { org.ovirt.engine.core.common.AuditLogSeverity severity = logType.getSeverity ( ) ; org.ovirt.engine.core.common.businessentities.AuditLog auditLog = createAuditLog ( auditLogable , logType , loggerString , severity ) ; if ( auditLog == null ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( "Unable to create AuditLog" ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.setPropertiesFromAuditLogableBase ( auditLogable , auditLog ) ; getDbFacadeInstance ( ) . getAuditLogDao ( ) . save ( auditLog ) ; logMessage ( severity , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageToLog ( loggerString , auditLog ) ) ; } }
Source:
private java.util.List < java.lang.Object > createItems ( ) { java.util.List < java.lang.Object > items = new java.util.ArrayList < java.lang.Object > ( ( ( ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ) * 2 ) ) ; for ( int i = 0 ; i < ( ( ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ) * 2 ) ; i ++ ) { items.add ( buildPropertyValue ( i ) ) ; } return items ; }

Target:
private java.util.List < java.lang.Object > createItems ( ) { java.util.List < java.lang.Object > items = new java.util.ArrayList ( ( ( ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ) * 2 ) ) ; for ( int i = 0 ; i < ( ( ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ) * 2 ) ; i ++ ) { items.add ( buildPropertyValue ( i ) ) ; } return items ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { super . onValueChange ( event ) ; if ( clientAgentType.isFirefox ( ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { com.google.gwt.dom.client.Node favicon = com.google.gwt.user.client.DOM.getElementById ( "id-link-favicon" ) ; if ( favicon != null ) { com.google.gwt.dom.client.Node parent = favicon.getParentNode ( ) ; favicon.removeFromParent ( ) ; parent.appendChild ( favicon ) ; } } } ) ; } }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { super . onValueChange ( event ) ; if ( clientAgentType.isFirefox ( ) ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( ( ) -> { com.google.gwt.dom.client.Node favicon = com.google.gwt.user.client.DOM.getElementById ( "id-link-favicon" ) ; if ( favicon != null ) { com.google.gwt.dom.client.Node parent = favicon.getParentNode ( ) ; favicon.removeFromParent ( ) ; parent.appendChild ( favicon ) ; } } ) ; } }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ENABLE_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void testResolveNetworkExclusivenessValidatorNew ( ) { final java.util.HashSet < org.ovirt.engine.core.compat.Version > supportedVersions = new java.util.HashSet ( java.util.Arrays.asList ( Version.v3_5 , Version.v3_6 ) ) ; final org.ovirt.engine.core.bll.validator.network.NetworkExclusivenessValidator actual = underTest.resolveNetworkExclusivenessValidator ( supportedVersions ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.CoreMatchers.sameInstance ( vlanUntaggedNetworkExclusivenessValidator ) ) ; }

Target:
public void testResolveNetworkExclusivenessValidatorNew ( ) { final org.ovirt.engine.core.bll.validator.network.NetworkExclusivenessValidator actual = underTest.resolveNetworkExclusivenessValidator ( ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.CoreMatchers.sameInstance ( vlanUntaggedNetworkExclusivenessValidator ) ) ; }
Source:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; restApiSessionManager.recordLoggedInTime ( ) ; }

Target:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { this . postInitQosList ( ( returnValue == null ? new java.util.ArrayList < Q > ( ) : ( ( java.util.List < Q > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object returnValue ) { this . postInitQosList ( ( returnValue == null ? new java.util.ArrayList < Q > ( ) : ( ( java.util.List < Q > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
private java.lang.String getPrintableDomainsList ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map : getDomainsList ( ) ) { sb.append ( "{ domainId: " ) ; sb.append ( map.getstorage_id ( ) ) ; sb.append ( ", status: " ) ; sb.append ( map.getstatus ( ) . name ( ) ) ; sb.append ( " };" ) ; } return sb.toString ( ) ; }

Target:
private java.lang.String getPrintableDomainsList ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map : getDomainsList ( ) ) { sb.append ( "{ domainId: " ) ; sb.append ( map.getstorage_id ( ) ) ; sb.append ( ", status: " ) ; sb.append ( map.getStatus ( ) . name ( ) ) ; sb.append ( " };" ) ; } return sb.toString ( ) ; }
Source:
public void validateFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( "InvalidActionType" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; params.setClusterId ( null ) ; params.setServerId ( null ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFails ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( "InvalidActionType" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void setUp ( ) { connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; connection.setstorage_type ( StorageType.ISCSI ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator ( connection ) ) ; domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStorageType ( StorageType.ISCSI ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; domain.setStatus ( StorageDomainStatus.Maintenance ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Inactive ) ; }

Target:
public void setUp ( ) { connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; connection.setStorageType ( StorageType.ISCSI ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator ( connection ) ) ; domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStorageType ( StorageType.ISCSI ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; domain.setStatus ( StorageDomainStatus.Maintenance ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Inactive ) ; }
Source:
private void addVmToPool ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmToPoolParameters parameters = new org.ovirt.engine.core.common.action.AddVmToPoolParameters ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getPoolId ( ) , vmStatic.getId ( ) ) ; parameters.setShouldBeLogged ( false ) ; setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.AddVmToPool , parameters ) . getSucceeded ( ) ) ; org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.addVmPermission ( ) ; }

Target:
private void addVmToPool ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmToPoolParameters parameters = new org.ovirt.engine.core.common.action.AddVmToPoolParameters ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getPoolId ( ) , vmStatic.getId ( ) ) ; parameters.setShouldBeLogged ( false ) ; setSucceeded ( runInternalAction ( VdcActionType.AddVmToPool , parameters ) . getSucceeded ( ) ) ; org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.addVmPermission ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { deactivate ( ) ; java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; activate ( ) ; postDoUpdateManagedFieldsFrom ( vmBase ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { deactivate ( ) ; java.util.List < java.lang.String > consoleDevices = returnValue.getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; activate ( ) ; postDoUpdateManagedFieldsFrom ( vmBase ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StoragePool findDataCenterById ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > list , org.ovirt.engine.core.compat.Guid id ) { for ( org.ovirt.engine.core.common.businessentities.StoragePool dc : list ) { if ( dc.getId ( ) . equals ( id ) ) { return dc ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool findDataCenterById ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > list , org.ovirt.engine.core.compat.Guid id ) { if ( id == null ) { return null ; } for ( org.ovirt.engine.core.common.businessentities.StoragePool dc : list ) { if ( dc.getId ( ) . equals ( id ) ) { return dc ; } } return null ; }
Source:
public void setUpOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; injectorRule.bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.mockito.Mockito.when ( osRepository.getVmWatchdogTypes ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateWatchdogCommandTest.WATCHDOG_MODELS ) ; }

Target:
public void setUpOsRepository ( ) { org.mockito.Mockito.when ( osRepository.getVmWatchdogTypes ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateWatchdogCommandTest.WATCHDOG_MODELS ) ; }
Source:
protected void createNumOfDesktopEditors ( ) { incraseNumOfVmsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.IntegerEntityModelTextBoxOnlyEditor ( ) ; numOfVmsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelTextBoxEditor < java.lang.Integer > ( new org.ovirt.engine.ui.common.widget.editor.generic.ToStringEntityModelRenderer < java.lang.Integer > ( ) , new com.google.gwt.text.shared.Parser < java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer parse ( java.lang.CharSequence text ) throws java.text.ParseException { return incraseNumOfVmsEditor.asEditor ( ) . getValue ( ) ; } } ) ; }

Target:
protected void createNumOfDesktopEditors ( ) { incraseNumOfVmsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.IntegerEntityModelTextBoxOnlyEditor ( ) ; numOfVmsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelTextBoxEditor ( new org.ovirt.engine.ui.common.widget.editor.generic.ToStringEntityModelRenderer < java.lang.Integer > ( ) , new com.google.gwt.text.shared.Parser < java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer parse ( java.lang.CharSequence text ) throws java.text.ParseException { return incraseNumOfVmsEditor.asEditor ( ) . getValue ( ) ; } } ) ; }
Source:
private void checkConnection ( ) throws java.sql.SQLException { java.sql.Statement statement = null ; java.sql.ResultSet rs = null ; try { statement = connection.createStatement ( ) ; rs = statement.executeQuery ( "select null" ) ; rs.next ( ) ; } finally { if ( rs != null ) { rs.close ( ) ; } if ( statement != null ) { statement.close ( ) ; } } }

Target:
private void checkConnection ( ) throws java.sql.SQLException { java.sql.Statement statement = null ; java.sql.ResultSet rs = null ; try { statement = connection.createStatement ( ) ; rs = statement.executeQuery ( "select null" ) ; rs.next ( ) ; } finally { if ( statement != null ) { statement.close ( ) ; } if ( rs != null ) { rs.close ( ) ; } } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean isSucceeded = retVal.getSucceeded ( ) ; if ( ( retVal != null ) && isSucceeded ) { vmListModel1.Cancel ( ) ; } }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.Cancel ( ) ; } }
Source:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( connectionId ) ) { org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getDbFacade ( ) . getStorageServerConnectionDao ( ) . remove ( connectionId ) ; } org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.lang.String connectionId = org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) . getid ( ) ; getStorageServerConnectionDao ( ) . remove ( connectionId ) ; org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.disconnectStorage ( ) ; org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.setSucceeded ( true ) ; }
Source:
public void testHasPeersFalse ( ) { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.anySetOf ( java.lang.String.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML_NO_PEERS ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.junit.Assert.assertTrue ( glusterUtil.getPeers ( client ) . isEmpty ( ) ) ; }

Target:
public void testHasPeersFalse ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML_NO_PEERS ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.junit.Assert.assertTrue ( glusterUtil.getPeers ( client ) . isEmpty ( ) ) ; }