auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm GetDefaultVdsSelectionAlgorithm ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VdsSelectionAlgorithm ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.valueOf ( ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ) ; } return org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.None ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm GetDefaultVdsSelectionAlgorithm ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VdsSelectionAlgorithm , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.valueOf ( ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ) ; } return org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm.None ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.lang.Iterable ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }

Target:
public void getHostListByStatus ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.common.businessentities.VDSStatus status , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParameters = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Host: " + ( status == null ? "" : "status=" + ( status.name ( ) ) ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; searchParameters.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? searchParameters : searchParameters.withoutRefresh ( ) ) , aQuery ) ; }
Source:
private void plugToExternalNetwork ( ) { java.util.Map < java.lang.String , java.lang.String > runtimeProperties = getProviderProxy ( ) . allocate ( getNetwork ( ) , vnicProfile , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) ) ; if ( runtimeProperties != null ) { org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getVm ( ) . getRuntimeDeviceCustomProperties ( ) . put ( vmDevice.getId ( ) , runtimeProperties ) ; } }

Target:
private void plugToExternalNetwork ( ) { java.util.Map < java.lang.String , java.lang.String > runtimeProperties = getProviderProxy ( ) . allocate ( getNetwork ( ) , vnicProfile , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getVds ( ) ) ; if ( runtimeProperties != null ) { org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getVm ( ) . getRuntimeDeviceCustomProperties ( ) . put ( vmDevice.getId ( ) , runtimeProperties ) ; } }
Source:
private void initConditions ( ) { org.mockito.Mockito.when ( dbFacade.getVdsGroupDao ( ) ) . thenReturn ( groupDao ) ; org.mockito.Mockito.when ( groupDao.get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.mockito.Matchers.any ( ) ) ) ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.when ( dbFacade.getInterfaceDao ( ) ) . thenReturn ( interfaceDao ) ; org.mockito.Mockito.when ( interfaceDao.getAllInterfacesForVds ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.mockito.Matchers.any ( ) ) ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) ) ; }

Target:
private void initConditions ( ) { org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( groupDao ) ; org.mockito.Mockito.when ( groupDao.get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.mockito.Matchers.any ( ) ) ) ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.when ( dbFacade.getInterfaceDao ( ) ) . thenReturn ( interfaceDao ) ; org.mockito.Mockito.when ( interfaceDao.getAllInterfacesForVds ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.mockito.Matchers.any ( ) ) ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) ) ; }
Source:
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 ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.isVmUp ( ) ) ; } else { getView ( ) . setSelected ( ) ; } }

Target:
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 ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.isVmUp ( ) , consoleInUse ( ) ) ; } else { getView ( ) . setSelected ( ) ; } }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel object ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.PosixStorageView.Driver.driver.edit ( object ) ; pathHintLabel.setVisible ( ( ( object.getPath ( ) . getIsAvailable ( ) ) && ( object.getPath ( ) . getIsChangable ( ) ) ) ) ; StyleTextBoxEditor ( pathEditor , object.getPath ( ) ) ; StyleTextBoxEditor ( vfsTypeEditor , object.getVfsType ( ) ) ; StyleTextBoxEditor ( mountOptionsEditor , object.getMountOptions ( ) ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel object ) { driver.edit ( object ) ; pathHintLabel.setVisible ( ( ( object.getPath ( ) . getIsAvailable ( ) ) && ( object.getPath ( ) . getIsChangable ( ) ) ) ) ; StyleTextBoxEditor ( pathEditor , object.getPath ( ) ) ; StyleTextBoxEditor ( vfsTypeEditor , object.getVfsType ( ) ) ; StyleTextBoxEditor ( mountOptionsEditor , object.getMountOptions ( ) ) ; }
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.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . 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.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 ( ) ) ; }
Source:
private void debugQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase parameters ) { if ( org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.isDebugEnabled ( ) ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "Query type: " ) ; builder.append ( queryType ) ; builder.append ( ", Parameters: " ) ; builder.append ( parameters ) ; org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( builder.toString ( ) ) ; } }

Target:
private void debugQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase parameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Query type '{}', Parameters '{}'" , queryType , parameters ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( args.propertyName.equals ( importModel.ON_DISK_LOAD ) ) { table.asEditor ( ) . edit ( table.asEditor ( ) . flush ( ) ) ; } else if ( args.propertyName.equals ( "Message" ) ) { message.setText ( importModel.getMessage ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( args.propertyName.equals ( importModel.ON_DISK_LOAD ) ) { table.asEditor ( ) . edit ( table.asEditor ( ) . flush ( ) ) ; } else if ( args.propertyName.equals ( "Message" ) ) { message.setText ( importModel.getMessage ( ) ) ; } else if ( args.propertyName.equals ( "WinWithoutVirtioMessage" ) ) { winWithoutVirtioMessage.setText ( importModel.getWinWithoutVirtioMessage ( ) ) ; } }
Source:
public void testNetworkExistWhenBothNetworkNameAndNetworkIdAreSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidatorTest.NETWORK_NAME ) ; networkAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( networkAttachment ) . networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkExistWhenBothNetworkNameAndNetworkIdAreSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidatorTest.NETWORK_NAME ) ; networkAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( createNetworkAttachmentValidator ( networkAttachment ) . networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public void getFloppyImageList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { getIrsImageList ( aQuery , storagePoolId , false , ImageFileType.Floppy ) ; }
Source:
public void shouldNotMigrateVmOnClusterTwoWhileMigrating ( ) { final org.ovirt.engine.core.common.businessentities.VM migratingVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; migratingVM.setClusterId ( cluster2.getId ( ) ) ; org.mockito.Mockito.when ( clusterDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Arrays.asList ( cluster1 ) ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void shouldNotMigrateVmOnClusterTwoWhileMigrating ( ) { final org.ovirt.engine.core.common.businessentities.VM migratingVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; migratingVM.setClusterId ( cluster2.getId ( ) ) ; org.mockito.Mockito.when ( clusterDao.getWithoutMigratingVms ( ) ) . thenReturn ( java.util.Collections.singletonList ( cluster1 ) ) ; arem.refresh ( ) ; org.mockito.Mockito.verify ( arem ) . migrateVM ( vm1 ) ; org.mockito.Mockito.verify ( arem , org.mockito.Mockito.times ( 1 ) ) . migrateVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public static void getWatchdogByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { org.ovirt.engine.api.model.Network entity = org.ovirt.engine.api.restapi.types.NetworkMapper.map ( network , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getNetworkIds ( ) . add ( entity.getId ( ) ) ; return performAction ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { org.ovirt.engine.api.model.Network entity = org.ovirt.engine.api.restapi.types.NetworkMapper.map ( network , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getNetworkIds ( ) . add ( entity.getId ( ) ) ; return performAction ( ActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.WatchDog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { validateEnums ( org.ovirt.engine.api.model.WatchDog.class , model ) ; org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setModel ( org.ovirt.engine.core.common.businessentities.VmWatchdogType.getByName ( model.getModel ( ) ) ) ; params.setAction ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction.getByName ( model.getAction ( ) ) ) ; params.setId ( parentId ) ; params.setVm ( parentIsVm ) ; return params ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Watchdog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { validateEnums ( org.ovirt.engine.api.model.Watchdog.class , model ) ; org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setModel ( org.ovirt.engine.core.common.businessentities.VmWatchdogType.getByName ( model.getModel ( ) ) ) ; params.setAction ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction.getByName ( model.getAction ( ) ) ) ; params.setId ( parentId ) ; params.setVm ( parentIsVm ) ; return params ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createImage ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( new org.ovirt.engine.core.compat.Guid ( ) ) ) ) ; return diskImage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createImage ( ) { final org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( new org.ovirt.engine.core.compat.Guid ( ) ) ) ) ; return diskImage ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.hosts = hosts ; clusterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.hosts = hosts ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "add" , "size" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "add" , "provisionedSize|size" , "format" , "interface" ) ; } }
Source:
public void setFallbackProtocol ( ) { final org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = this . vds.getStaticData ( ) ; vdsStatic.setProtocol ( VdsProtocol.XML ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( vdsStatic ) ; return null ; } } ) ; }

Target:
private void setFallbackProtocol ( org.ovirt.engine.core.common.businessentities.VdsProtocol protocol ) { final org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = this . vds.getStaticData ( ) ; vdsStatic.setProtocol ( protocol ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { vdsStaticDao.update ( vdsStatic ) ; return null ; } } ) ; }
Source:
protected void dataCenter_SelectedItemChanged ( ) { updateStorageDomains ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; }

Target:
protected void dataCenter_SelectedItemChanged ( ) { updateStorageDomains ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; updateClusters ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; }
Source:
private void initListeners ( final org.ovirt.engine.ui.uicommonweb.models.userportal.IUserPortalListModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = extractSpice ( model ) ; if ( spice == null ) { return ; } viewUpdatingListener = new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { getView ( ) . edit ( model ) ; } } ; spice.getUsbAutoShareChangedEvent ( ) . addListener ( viewUpdatingListener ) ; spice.getWANColorDepthChangedEvent ( ) . addListener ( viewUpdatingListener ) ; spice.getWANDisableEffectsChangeEvent ( ) . addListener ( viewUpdatingListener ) ; }

Target:
private void initListeners ( final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalConsolePopupModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = extractSpice ( model ) ; if ( spice == null ) { return ; } viewUpdatingListener = new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { getView ( ) . edit ( model ) ; } } ; spice.getUsbAutoShareChangedEvent ( ) . addListener ( viewUpdatingListener ) ; spice.getWANColorDepthChangedEvent ( ) . addListener ( viewUpdatingListener ) ; spice.getWANDisableEffectsChangeEvent ( ) . addListener ( viewUpdatingListener ) ; }
Source:
private void addEventsHandlers ( final org.ovirt.engine.ui.uicommonweb.models.storage.ImportFcpStorageModel object ) { object.getPropertyChangedEvent ( ) . 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 ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } else if ( propName.equals ( "Message" ) ) { message.setText ( object.getMessage ( ) ) ; } } } ) ; }

Target:
private void addEventsHandlers ( final org.ovirt.engine.ui.uicommonweb.models.storage.ImportFcpStorageModel object ) { object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } else if ( propName.equals ( "Message" ) ) { message.setText ( object.getMessage ( ) ) ; } } } ) ; }
Source:
public void testIsBlockDomain ( ) { junit.framework.Assert.assertTrue ( StorageType.FCP.isBlockDomain ( ) ) ; junit.framework.Assert.assertTrue ( StorageType.ISCSI.isBlockDomain ( ) ) ; junit.framework.Assert.assertFalse ( StorageType.NFS.isBlockDomain ( ) ) ; junit.framework.Assert.assertFalse ( StorageType.LOCALFS.isBlockDomain ( ) ) ; junit.framework.Assert.assertFalse ( StorageType.POSIXFS.isBlockDomain ( ) ) ; }

Target:
public void testIsBlockDomain ( ) { junit.framework.Assert.assertTrue ( StorageType.FCP.isBlockDomain ( ) ) ; junit.framework.Assert.assertTrue ( StorageType.ISCSI.isBlockDomain ( ) ) ; junit.framework.Assert.assertFalse ( StorageType.NFS.isBlockDomain ( ) ) ; junit.framework.Assert.assertFalse ( StorageType.LOCALFS.isBlockDomain ( ) ) ; junit.framework.Assert.assertFalse ( StorageType.POSIXFS.isBlockDomain ( ) ) ; junit.framework.Assert.assertFalse ( StorageType.GLUSTERFS.isBlockDomain ( ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) != null ? org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; }
Source:
public java.lang.Object lookupEntity ( java.lang.Object id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.businessentities.VM vm = doGetEntity ( org.ovirt.engine.core.common.businessentities.VM.class , query , getQueryParams ( queryParamsClass , id ) , id.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM model = new org.ovirt.engine.core.common.businessentities.VM ( ) ; model.setId ( vm.getId ( ) . toString ( ) ) ; return org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , model ) ; }

Target:
public java.lang.Object lookupEntity ( java.lang.Object id ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { org.ovirt.engine.core.common.businessentities.VM vm = doGetEntity ( org.ovirt.engine.core.common.businessentities.VM.class , query , getQueryParams ( queryParamsClass , id ) , id.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VM model = new org.ovirt.engine.core.common.businessentities.VM ( ) ; model.setId ( vm.getId ( ) . toString ( ) ) ; return org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , model ) ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getguest_last_login_time ( ) ) != null ) && ( ( ( getguest_last_logout_time ( ) ) == null ) || ( ( getguest_last_login_time ( ) . compareTo ( getguest_last_logout_time ( ) ) ) > 0 ) ) ) { setguest_last_logout_time ( new java.util.Date ( ) ) ; } }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > getImages ( ) { return vmStatic.getImages ( ) ; }
Source:
public javax.xml.bind.Marshaller getMarshaller ( ) throws javax.xml.bind.JAXBException { if ( ( marshaller ) == null ) { marshaller = context.createMarshaller ( ) ; marshaller.setProperty ( javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT , true ) ; } return marshaller ; }

Target:
public javax.xml.bind.Marshaller getMarshaller ( ) throws javax.xml.bind.JAXBException { if ( ( marshaller ) == null ) { marshaller = context.createMarshaller ( ) ; marshaller.setProperty ( javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT , true ) ; marshaller.setProperty ( javax.xml.bind.Marshaller.JAXB_ENCODING , StringUtils.UTF8.toString ( ) ) ; } return marshaller ; }
Source:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; if ( ! smartcardEnabled ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else if ( vmDevices.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }

Target:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; if ( ! smartcardEnabled ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else if ( vmDevices.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }
Source:
private void mockValidateCustomProperties ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.< org.ovirt.engine.core.common.utils.customprop.ValidationError > emptyList ( ) ) . when ( command ) . validateCustomProperties ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) ) ; }

Target:
private void prepareVmToPassCanDoAction ( ) { vmStatic.setName ( "vm1" ) ; vmStatic.setMemSizeMb ( 256 ) ; vmStatic.setSingleQxlPci ( false ) ; mockVmDaoGetVm ( ) ; mockSameNameQuery ( false ) ; mockValidateCustomProperties ( ) ; mockValidatePciAndIdeLimit ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; mockGraphicsDevice ( ) ; }
Source:
public void testAdd ( ) throws java.lang.Exception { setUpAddExpectations ( ) ; setUpCreationExpectations ( ) ; javax.ws.rs.core.Response response = doAdd ( getRestModel ( 0 ) ) ; assertEquals ( 201 , response.getStatus ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.verifyModel ( ( ( R ) ( response.getEntity ( ) ) ) , 0 ) ; assertNull ( ( ( R ) ( response.getEntity ( ) ) ) . getCreationStatus ( ) ) ; }

Target:
public void testAdd ( ) throws java.lang.Exception { setUpAddExpectations ( ) ; setUpCreationExpectations ( ) ; javax.ws.rs.core.Response response = doAdd ( getRestModel ( 0 ) ) ; org.junit.Assert.assertEquals ( 201 , response.getStatus ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.verifyModel ( ( ( R ) ( response.getEntity ( ) ) ) , 0 ) ; org.junit.Assert.assertNull ( ( ( R ) ( response.getEntity ( ) ) ) . getCreationStatus ( ) ) ; }
Source:
public void getStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getTemplateDiskList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected boolean checkNumberOfMonitors ( ) { return org.ovirt.engine.core.bll.VmHandler.isNumOfMonitorsLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfMonitors ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected void setDefaultMigrationPolicy ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getArchitecture ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE : org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ; org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . setMigrationSupport ( migrationSupport ) ; } }
Source:
private boolean registerLibvirtSecrets ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByStoragePoolIdFilteredByActiveStorageDomains ( getStoragePoolId ( ) ) ; if ( ! ( libvirtSecrets.isEmpty ( ) ) ) { return registerLibvirtSecrets ( libvirtSecrets , false ) ; } return true ; }

Target:
private boolean registerLibvirtSecrets ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByStoragePoolIdFilteredByActiveStorageDomains ( getStoragePoolId ( ) ) ; if ( ( ! ( libvirtSecrets.isEmpty ( ) ) ) && ( ! ( registerLibvirtSecrets ( libvirtSecrets , false ) ) ) ) { setNonOperational ( NonOperationalReason.LIBVIRT_SECRETS_REGISTRATION_FAILURE ) ; return false ; } return true ; }
Source:
private void logProxySelection ( java.lang.String proxy , java.lang.String origin , java.lang.String command ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Proxy" , proxy ) ; logable.addCustomValue ( "Origin" , origin ) ; logable.addCustomValue ( "Command" , command ) ; logable.setVdsId ( _vds.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.PROXY_HOST_SELECTION ) ; org.ovirt.engine.core.bll.FenceExecutor.log.infoFormat ( "Using Host {0} from {1} as proxy to execute {2} command on Host {3}" , proxy , origin , command , _vds.getName ( ) ) ; }

Target:
public org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fence ( org.ovirt.engine.core.common.businessentities.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent ) { boolean withRetries = action != ( org.ovirt.engine.core.common.businessentities.FenceActionType.Status ) ; org.ovirt.engine.core.common.businessentities.VDS proxyHost = new org.ovirt.engine.core.bll.FenceProxyLocator ( _vds , fencingPolicy ) . findProxyHost ( withRetries ) ; if ( proxyHost == null ) { return proxyNotFound ( ) ; } else { return fence ( action , agent , proxyHost ) ; } }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( lun ) == null ? 0 : lun.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( usingScsiReservation ) == null ? 0 : usingScsiReservation.hashCode ( ) ) ; result = ( prime * result ) + ( ( lun ) == null ? 0 : lun.hashCode ( ) ) ; return result ; }
Source:
protected void auditLogMacInUse ( final org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "MACAddr" , iface.getMacAddress ( ) ) ; logable.addCustomValue ( "VmName" , iface.getVmName ( ) ) ; log ( logable , AuditLogType.MAC_ADDRESS_IS_IN_USE ) ; return null ; } } ) ; }

Target:
private org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase createAuditLog ( final org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( iface.getVmId ( ) . getValue ( ) ) ; logable.addCustomValue ( "MACAddr" , iface.getMacAddress ( ) ) ; logable.addCustomValue ( "IfaceName" , iface.getName ( ) ) ; return logable ; }
Source:
private static void putHost ( java.util.Map < java.lang.String , java.util.Set < org.ovirt.engine.core.common.businessentities.VDS > > osToHostIdMap , org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.bll.scheduling.OS hostOs ) { if ( ! ( osToHostIdMap.containsKey ( hostOs.getName ( ) ) ) ) { osToHostIdMap.put ( hostOs.getName ( ) , new java.util.HashSet < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; } osToHostIdMap.get ( hostOs.getName ( ) ) . add ( host ) ; }

Target:
private static void putHost ( java.util.Map < java.lang.String , java.util.Set < org.ovirt.engine.core.common.businessentities.VDS > > osToHostIdMap , org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.bll.scheduling.OS hostOs ) { if ( ! ( osToHostIdMap.containsKey ( hostOs.getOsFamily ( ) ) ) ) { osToHostIdMap.put ( hostOs.getOsFamily ( ) , new java.util.HashSet < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; } osToHostIdMap.get ( hostOs.getOsFamily ( ) ) . add ( host ) ; }
Source:
public void testHostsRuleStructure ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnforcing ( true ) ; rule.setPositive ( false ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVdsAffinityRule ( ) ) ; assertEquals ( true , entity.isVdsEnforcing ( ) ) ; }

Target:
public void testHostsRuleStructure ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( true ) ; rule.setPositive ( false ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVdsAffinityRule ( ) ) ; assertEquals ( true , entity.isVdsEnforcing ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VolumeFormat GetDiskVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { switch ( storageType ) { case NFS : case LOCALFS : case POSIXFS : case GLUSTERFS : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; case ISCSI : case FCP : switch ( volumeType ) { case Sparse : return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; case Preallocated : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } }

Target:
public static org.ovirt.engine.core.common.businessentities.VolumeFormat getDiskVolumeFormat ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; } else if ( storageType.isBlockDomain ( ) ) { switch ( volumeType ) { case Sparse : return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; case Preallocated : return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; default : return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } } else { return org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ; } }
Source:
public int getMaxNameLength ( ) { final java.lang.Integer selectedOsId = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isWindowsOsType ( selectedOsId ) ? org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLengthWin ( ) : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLengthNonWin ( ) ; }

Target:
public int getMaxNameLength ( ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmNameLength ( ) ; }
Source:
public void getDefaultSpmPriority ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getMaxSpmPriority ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
private void addWatchdogActions ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.restapi.types.WatchdogAction [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_3 ) ) { version.setWatchdogActions ( new org.ovirt.engine.api.model.WatchdogActions ( ) ) ; for ( org.ovirt.engine.api.restapi.types.WatchdogAction watchdogAction : values ) { version.getWatchdogActions ( ) . getWatchdogActions ( ) . add ( watchdogAction.value ( ) ) ; } } }

Target:
private void addWatchdogActions ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.WatchdogAction [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_3 ) ) { version.setWatchdogActions ( new org.ovirt.engine.api.model.WatchdogActions ( ) ) ; for ( org.ovirt.engine.api.model.WatchdogAction watchdogAction : values ) { version.getWatchdogActions ( ) . getWatchdogActions ( ) . add ( watchdogAction.value ( ) ) ; } } }
Source:
public void testPersistentAuthIgnoresCase ( ) { org.junit.Assert.assertTrue ( isPersistentAuth ( "Persistent-Auth" ) ) ; org.junit.Assert.assertTrue ( isPersistentAuth ( "PERSISTENT-AUTH" ) ) ; }

Target:
public void testPreferIgnoresCase ( ) { org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "Persistent-Auth" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "PERSISTENT-AUTH" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "new-auth" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "NEW-AUTH" ) ) ; }