auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateActionAvailability ( ) { java.util.List tempVar = getSelectedItems ( ) ; java.util.ArrayList selectedItems = ( ( java.util.ArrayList ) ( ( tempVar != null ) ? tempVar : new java.util.ArrayList ( ) ) ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) > 0 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > tempVar = getSelectedItems ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > selectedItems = ( tempVar != null ) ? tempVar : new java.util.ArrayList ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) > 0 ) ) ; }
Source:
public void testUpdateSupportedClusterFeature ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > features = dao.getSupportedFeaturesByClusterId ( org.ovirt.engine.core.dao.ClusterFeatureDaoTest.EXISTING_VDS_GROUP ) ; for ( org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature feature : features ) { feature.setEnabled ( false ) ; dao.updateSupportedClusterFeature ( feature ) ; break ; } java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > newFeatureSet = dao.getSupportedFeaturesByClusterId ( org.ovirt.engine.core.dao.ClusterFeatureDaoTest.EXISTING_VDS_GROUP ) ; org.junit.Assert.assertEquals ( "Failed to update the feature set" , new java.util.HashSet ( features ) , newFeatureSet ) ; }

Target:
public void testUpdateSupportedClusterFeature ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > features = dao.getSupportedFeaturesByClusterId ( org.ovirt.engine.core.dao.ClusterFeatureDaoTest.EXISTING_CLUSTER ) ; for ( org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature feature : features ) { feature.setEnabled ( false ) ; dao.updateSupportedClusterFeature ( feature ) ; break ; } java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > newFeatureSet = dao.getSupportedFeaturesByClusterId ( org.ovirt.engine.core.dao.ClusterFeatureDaoTest.EXISTING_CLUSTER ) ; org.junit.Assert.assertEquals ( "Failed to update the feature set" , new java.util.HashSet ( features ) , newFeatureSet ) ; }
Source:
private void addVideoCardByDisplayType ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.VIDEO.getValue ( ) ) ; struct.put ( VdsProperties.Device , displayType.getVmDeviceType ( ) . getName ( ) ) ; struct.put ( VdsProperties.SpecParams , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.getNewMonitorSpecParams ( ) ) ; struct.put ( VdsProperties.DeviceId , java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ; devices.add ( struct ) ; }

Target:
private void addVideoCardByDisplayType ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.VIDEO.getValue ( ) ) ; struct.put ( VdsProperties.Device , displayType.getVmDeviceType ( ) . getName ( ) ) ; struct.put ( VdsProperties.SpecParams , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.getNewMonitorSpecParams ( ) ) ; struct.put ( VdsProperties.DeviceId , java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; devices.add ( struct ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getGlusterVolumeDao ( ) ; server = dbFacade.getVdsStaticDAO ( ) . get ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.SERVER_ID ) ; existingDistVol = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_DIST_ID ) ; existingReplVol = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getGlusterVolumeDao ( ) ; server = dbFacade.getVdsStaticDao ( ) . get ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.SERVER_ID ) ; existingDistVol = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_DIST_ID ) ; existingReplVol = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; }
Source:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.ovirt.engine.core.utils.log.Log log = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.log.Log.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . debugFormat ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_RETURN_VALUE ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) ) ; }

Target:
public void testLogReturnLogsWhenLogLevelActiveAndExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_RETURN_VALUE ) , new java.lang.Object [ ] { org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) } ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getCreateVolumeCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewVolumeCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.AddVmFromScratchCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getActionType ( ) . getActionGroup ( ) ) ) ; addPermissionSubjectForCustomProperties ( permissionList ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmFromScratchCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmFromScratchCommand.getActionType ( ) . getActionGroup ( ) ) ) ; addPermissionSubjectForCustomProperties ( permissionList ) ; return permissionList ; }
Source:
private boolean isNetworkLabelExistInTargetHost ( java.lang.String networkName , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > targetNetworksByName ) { org.ovirt.engine.core.common.businessentities.network.Network targetNetwork = targetNetworksByName.get ( networkName ) ; return ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( targetNetwork ) ) && ( isHostContainLabel ( targetNetwork.getLabel ( ) ) ) ; }

Target:
private boolean isNetworkLabelExistInTargetHost ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String networkName , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > targetNetworksByName ) { org.ovirt.engine.core.common.businessentities.network.Network targetNetwork = targetNetworksByName.get ( networkName ) ; return ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( targetNetwork ) ) && ( isHostContainLabel ( hostId , targetNetwork.getLabel ( ) ) ) ; }
Source:
public void removeAllForVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertFalse ( interfaces.isEmpty ( ) ) ; dao.removeAllForVms ( java.util.Collections.singletonList ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ) ; interfaces = dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertTrue ( interfaces.isEmpty ( ) ) ; }

Target:
public void save ( ) { org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface guestAgentInterface = createVmGuestAgentInterface ( ) ; org.junit.Assert.assertFalse ( dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) . contains ( guestAgentInterface ) ) ; dao.save ( guestAgentInterface ) ; org.junit.Assert.assertTrue ( dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) . contains ( guestAgentInterface ) ) ; }
Source:
private void initHostKdumpDetectionStatus ( ) { getDbFacade ( ) . getVdsKdumpStatusDao ( ) . remove ( getVdsId ( ) ) ; if ( ( ( getVds ( ) . isPmEnabled ( ) ) && ( getVds ( ) . isPmKdumpDetection ( ) ) ) && ( ( getVds ( ) . getKdumpStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.KdumpStatus.ENABLED ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase base = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; base.setVds ( getVds ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( base , AuditLogType.KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS ) ; } }

Target:
private void initHostKdumpDetectionStatus ( ) { getDbFacade ( ) . getVdsKdumpStatusDao ( ) . remove ( getVdsId ( ) ) ; if ( ( ( getVds ( ) . isPmEnabled ( ) ) && ( getVds ( ) . isPmKdumpDetection ( ) ) ) && ( ( getVds ( ) . getKdumpStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.KdumpStatus.ENABLED ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase base = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; base.setVds ( getVds ( ) ) ; auditLogDirector.log ( base , AuditLogType.KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS ) ; } }
Source:
private boolean areAgentsVersionCompatible ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; boolean supported = true ; for ( org.ovirt.engine.core.common.businessentities.FenceAgent agent : vds.getFenceAgents ( ) ) { supported = supported && ( options.isAgentSupported ( agent.getType ( ) ) ) ; } return supported ; }

Target:
private boolean areAgentsVersionCompatible ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( vds.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; boolean supported = true ; for ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent : vds.getFenceAgents ( ) ) { supported = supported && ( options.isAgentSupported ( agent.getType ( ) ) ) ; } return supported ; }
Source:
public void setUp ( ) { setXmlResponse ( "hosts/123/iscsidiscover" , 200 , "<action/>" ) ; startServer ( ) ; connection = testConnection ( ) ; vmsService = connection.systemService ( ) . vmsService ( ) ; }

Target:
public void setUp ( ) { setXmlResponse ( "hosts/123/iscsidiscover" , 200 , ( "<action>" + ( ( ( ( ( ( ( ( ( ( ( ( ( "<iscsi>" + "<address>iscsi.example.com</address>" ) + "<port>3260</port>" ) + "</iscsi>" ) + "<iscsi_targets>" ) + "<iscsi_target>myiqn</iscsi_target>" ) + "</iscsi_targets>" ) + "<discovered_targets>" ) + "<iscsi_details>" ) + "<address>192.168.121.102</address>" ) + "<port>3260</port>" ) + "</iscsi_details>" ) + "</discovered_targets>" ) + "</action>" ) ) ) ; startServer ( ) ; connection = testConnection ( ) ; vmsService = connection.systemService ( ) . vmsService ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > getProvidedExtensions ( java.lang.String provides ) { java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.extensions.mgr.ExtensionsManager.ExtensionEntry entry : loadedEntries.values ( ) ) { if ( ( entry.activated ) && ( entry.extension.getContext ( ) . < java.util.List > get ( Base.ContextKeys.PROVIDES ) . contains ( provides ) ) ) { results.add ( entry.extension ) ; } } return results ; }

Target:
public java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > getExtensionsByService ( java.lang.String provides ) { java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.extensions.mgr.ExtensionsManager.ExtensionEntry entry : initializedEntries.values ( ) ) { if ( entry.extension.getContext ( ) . < java.util.List > get ( Base.ContextKeys.PROVIDES ) . contains ( provides ) ) { results.add ( entry.extension ) ; } } return results ; }
Source:
public static void GetMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetClusterList ( 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 ) { 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 > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }
Source:
private org.ovirt.engine.api.model.Labels mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > networkLabels ) { org.ovirt.engine.api.model.Labels labels = new org.ovirt.engine.api.model.Labels ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel networkLabel : networkLabels ) { org.ovirt.engine.api.model.Label label = new org.ovirt.engine.api.model.Label ( ) ; label.setId ( networkLabel.getId ( ) ) ; labels.getLabels ( ) . add ( label ) ; addLinks ( label , org.ovirt.engine.api.model.Network.class ) ; } return labels ; }

Target:
private org.ovirt.engine.api.model.NetworkLabels mapCollection ( java.util.List < org.ovirt.engine.api.model.NetworkLabel > networkLabels ) { org.ovirt.engine.api.model.NetworkLabels labels = new org.ovirt.engine.api.model.NetworkLabels ( ) ; for ( org.ovirt.engine.api.model.NetworkLabel networkLabel : networkLabels ) { org.ovirt.engine.api.model.NetworkLabel label = new org.ovirt.engine.api.model.NetworkLabel ( ) ; label.setId ( networkLabel.getId ( ) ) ; labels.getNetworkLabels ( ) . add ( label ) ; addLinks ( label , org.ovirt.engine.api.model.Network.class ) ; } return labels ; }
Source:
public static 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 ) ; }

Target:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { disk = org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getParameters ( ) . getDiskId ( ) ) ; return ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmUpOrDown ( ) ) ) && ( isDiskExist ( disk ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( validate ( new org.ovirt.engine.core.bll.snapshots.SnapshotsValidator ( ) . vmNotDuringSnapshot ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmId ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { disk = org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getParameters ( ) . getDiskId ( ) ) ; return ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmUpOrDown ( ) ) ) && ( isDiskExist ( disk ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( validate ( getSnapshotsValidator ( ) . vmNotDuringSnapshot ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmId ( ) ) ) ) ; }
Source:
private static boolean canPlugInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmIfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; if ( vmIfaceManager.existsPluggedInterfaceWithSameMac ( iface ) ) { vmIfaceManager.auditLogMacInUseUnplug ( iface ) ; return false ; } else { return true ; } }

Target:
private static boolean canPlugInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface , org.ovirt.engine.core.compat.Guid vdsGroupId ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVdsGroupDao ( ) . get ( vdsGroupId ) ; org.ovirt.engine.core.compat.Guid dataCenterId = ( vdsGroup == null ) ? null : vdsGroup.getStoragePoolId ( ) ; boolean canPlugInterface = org.ovirt.engine.core.bll.utils.VmDeviceUtils.canPlugInterfaceInDc ( iface , dataCenterId ) ; if ( ! canPlugInterface ) { new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . auditLogMacInUseUnplug ( iface ) ; } return canPlugInterface ; }
Source:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; validateFailedWithReason ( EngineMessage.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }

Target:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }
Source:
void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; tempVar.setstatus ( VMStatus.Down ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setdisplay_type ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getdefault_display_type ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = tempVar ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . save ( vmDynamic ) ; org.ovirt.engine.core.bll.AddVmCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDynamic ) ; }

Target:
void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; tempVar.setstatus ( VMStatus.Down ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setdisplay_type ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getdefault_display_type ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = tempVar ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . save ( vmDynamic ) ; org.ovirt.engine.core.bll.AddVmCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDynamic ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; service.setServerId ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ; service.setServiceId ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.UNKNOWN ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; service.setHostName ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME1 ) ; dao.save ( service ) ; return service ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ; service.setServerId ( FixturesTool.GLUSTER_BRICK_SERVER1 ) ; service.setServiceId ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.UNKNOWN ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; service.setHostName ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.VDS_NAME1 ) ; dao.save ( service ) ; return service ; }
Source:
public void setType ( org.ovirt.engine.core.common.utils.VmDeviceType type ) { this . type = type ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VmDevice ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmPayload other = ( ( org.ovirt.engine.core.common.businessentities.VmPayload ) ( obj ) ) ; return ( ( super . equals ( obj ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( volumeId , other.volumeId ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( files , other.files ) ) ; }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { 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.storage_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static void GetStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public boolean isSessionInUse ( long sessionSeqId ) { org.ovirt.engine.core.compat.CommandStatus cmdStatus ; for ( org.ovirt.engine.core.compat.Guid cmdId : org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandIdsBySessionSeqId ( sessionSeqId ) ) { cmdStatus = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandStatus ( cmdId ) ; if ( ( cmdStatus == ( org.ovirt.engine.core.compat.CommandStatus.NOT_STARTED ) ) || ( cmdStatus == ( org.ovirt.engine.core.compat.CommandStatus.ACTIVE ) ) ) { return true ; } } return ! ( jobDao.getJobsBySessionSeqIdAndStatus ( sessionSeqId , JobExecutionStatus.STARTED ) . isEmpty ( ) ) ; }

Target:
public boolean isSessionInUse ( long sessionSeqId ) { org.ovirt.engine.core.compat.CommandStatus cmdStatus ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandCoordinatorUtil.get ( ) . getCommandIdsBySessionSeqId ( sessionSeqId ) ) { cmdStatus = commandCoordinatorUtil.get ( ) . getCommandStatus ( cmdId ) ; if ( ( cmdStatus == ( org.ovirt.engine.core.compat.CommandStatus.NOT_STARTED ) ) || ( cmdStatus == ( org.ovirt.engine.core.compat.CommandStatus.ACTIVE ) ) ) { return true ; } } return ! ( jobDao.getJobsBySessionSeqIdAndStatus ( sessionSeqId , JobExecutionStatus.STARTED ) . isEmpty ( ) ) ; }
Source:
private void refreshCapabilities ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RefreshHostCapabilities , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; } }
Source:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.NetworkCluster > before = dao.getAllForNetwork ( networkNoCluster.getId ( ) ) ; org.junit.Assert.assertTrue ( before.isEmpty ( ) ) ; dao.save ( newNetworkCluster ) ; java.util.List < org.ovirt.engine.core.common.businessentities.NetworkCluster > after = dao.getAllForNetwork ( networkNoCluster.getId ( ) ) ; org.junit.Assert.assertFalse ( after.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( newNetworkCluster , after.get ( 0 ) ) ; }

Target:
public void testSave ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > before = dao.getAllForNetwork ( networkNoCluster.getId ( ) ) ; org.junit.Assert.assertTrue ( before.isEmpty ( ) ) ; dao.save ( newNetworkCluster ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > after = dao.getAllForNetwork ( networkNoCluster.getId ( ) ) ; org.junit.Assert.assertFalse ( after.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( newNetworkCluster , after.get ( 0 ) ) ; }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.warnFormat ( logMessage ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( mCurrentVdsId ) ; logable.setStorageDomainId ( masterDomainId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC ) ; return org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . masterDomainNotOperational ( masterDomainId , storagePoolId , false , true ) ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.warn ( logMessage ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( mCurrentVdsId ) ; logable.setStorageDomainId ( masterDomainId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.SYSTEM_MASTER_DOMAIN_NOT_IN_SYNC ) ; return org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . masterDomainNotOperational ( masterDomainId , storagePoolId , false , true ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.image_storage_domain_map saveImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . save ( diskImage.getImage ( ) ) ; org.ovirt.engine.core.common.businessentities.image_storage_domain_map image_storage_domain_map = new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( diskImage.getImageId ( ) , diskImage.getstorage_ids ( ) . get ( 0 ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . save ( image_storage_domain_map ) ; return image_storage_domain_map ; }

Target:
public static org.ovirt.engine.core.common.businessentities.image_storage_domain_map saveImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . save ( diskImage.getImage ( ) ) ; org.ovirt.engine.core.common.businessentities.image_storage_domain_map image_storage_domain_map = new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( diskImage.getImageId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . save ( image_storage_domain_map ) ; return image_storage_domain_map ; }
Source:
public void testGetAllForVMs ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > > vmDisksMap = dao.getAllForVms ( java.util.Collections.singletonList ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; org.junit.Assert.assertTrue ( vmDisksMap.containsKey ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; org.ovirt.engine.core.dao.DiskDaoTest.assertFullGetAllForVMResult ( vmDisksMap.get ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; }

Target:
public void testGetAllForVMs ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > > vmDisksMap = dao.getAllForVms ( java.util.Collections.singletonList ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( vmDisksMap.containsKey ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; org.ovirt.engine.core.dao.DiskDaoTest.assertFullGetAllForVMResult ( vmDisksMap.get ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; }
Source:
private void forceRemoveStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { org.ovirt.engine.core.common.businessentities.StorageDomain masterDomain = null ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { if ( ( storageDomain.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { if ( ( storageDomain.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { removeDomainFromDb ( storageDomain ) ; } } else { masterDomain = storageDomain ; } } if ( masterDomain != null ) { removeDomainFromDb ( masterDomain ) ; } }

Target:
private void forceRemoveStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { org.ovirt.engine.core.common.businessentities.StorageDomain masterDomain = null ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { if ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { if ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { removeDomainFromDb ( storageDomain ) ; } } else { masterDomain = storageDomain ; } } if ( masterDomain != null ) { removeDomainFromDb ( masterDomain ) ; } }
Source:
private boolean isSpecifiedDisksExist ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { if ( ( disks == null ) || ( disks.isEmpty ( ) ) ) { return true ; } org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = createDiskImageValidator ( disks ) ; if ( ! ( validate ( diskImagesValidator.diskImagesNotExist ( ) ) ) ) { return false ; } return true ; }

Target:
private boolean isSpecifiedDisksExist ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { if ( ( disks == null ) || ( disks.isEmpty ( ) ) ) { return true ; } org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = createDiskImageValidator ( disks ) ; if ( ! ( validate ( diskImagesValidator.diskImagesNotExist ( ) ) ) ) { return false ; } return true ; }
Source:
public void updateSortOptions ( java.lang.String sortBy , boolean sortAscending ) { boolean shouldRefresh = ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( this . sortBy , sortBy ) ) ) || ( ( this . sortAscending ) != sortAscending ) ; this . sortBy = sortBy ; this . sortAscending = sortAscending ; if ( shouldRefresh ) { searchString = stripPageKeyword ( searchString ) ; setSearchStringPage ( 1 ) ; refresh ( ) ; } }

Target:
public void updateSortOptions ( java.lang.String sortBy , boolean sortAscending ) { boolean shouldRefresh = ( ! ( java.util.Objects.equals ( this . sortBy , sortBy ) ) ) || ( ( this . sortAscending ) != sortAscending ) ; this . sortBy = sortBy ; this . sortAscending = sortAscending ; if ( shouldRefresh ) { searchString = stripPageKeyword ( searchString ) ; setSearchStringPage ( 1 ) ; refresh ( ) ; } }
Source:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { return performAction ( VdcActionType.RemoveVds , new org.ovirt.engine.core.common.action.RemoveVdsParameters ( asGuid ( id ) ) ) ; }

Target:
protected org.ovirt.engine.api.model.Host deprecatedPopulate ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } addCertificateInfo ( model ) ; return model ; }
Source:
public static boolean isLastSuperUserGroup ( org.ovirt.engine.core.compat.Guid groupId ) { boolean retValue = false ; java.util.List < org.ovirt.engine.core.common.businessentities.Permission > permissions = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getPermissionDao ( ) . getAllForRole ( PredefinedRoles.SUPER_USER.getId ( ) ) ; if ( ( permissions.size ( ) ) <= 1 ) { permissions = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getPermissionDao ( ) . getAllForAdElement ( groupId ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : permissions ) { if ( permission.getRoleId ( ) . equals ( PredefinedRoles.SUPER_USER.getId ( ) ) ) { retValue = true ; break ; } } } return retValue ; }

Target:
public boolean isLastSuperUserGroup ( org.ovirt.engine.core.compat.Guid groupId ) { boolean retValue = false ; java.util.List < org.ovirt.engine.core.common.businessentities.Permission > permissions = permissionDao.getAllForRole ( PredefinedRoles.SUPER_USER.getId ( ) ) ; if ( ( permissions.size ( ) ) <= 1 ) { permissions = permissionDao.getAllForAdElement ( groupId ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : permissions ) { if ( permission.getRoleId ( ) . equals ( PredefinedRoles.SUPER_USER.getId ( ) ) ) { retValue = true ; break ; } } } return retValue ; }
Source:
public < T extends java.lang.Object > T instanceOf ( java.lang.Class < T > clazz ) { javax.enterprise.inject.spi.Bean < ? > bean = org.ovirt.engine.core.di.Injector.injector.manager.getBeans ( clazz ) . iterator ( ) . next ( ) ; return ( ( T ) ( org.ovirt.engine.core.di.Injector.injector.manager.getReference ( bean , clazz , org.ovirt.engine.core.di.Injector.injector.manager.createCreationalContext ( bean ) ) ) ) ; }

Target:
public javax.enterprise.inject.spi.BeanManager getManager ( ) { return javax.enterprise.inject.spi.CDI.current ( ) . getBeanManager ( ) ; }
Source:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { if ( ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getStatus ( ) ) != status ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }

Target:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VdsDynamic currentHost = org.ovirt.engine.core.bll.FenceVdsBaseCommand.getDbFacade ( ) . getVdsDynamicDao ( ) . get ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) ) ; if ( ( currentHost != null ) && ( ( currentHost.getStatus ( ) ) != status ) ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }
Source:
private void initProfileNetwork ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel model ) { model.getNetwork ( ) . setItems ( java.util.Arrays.< org.ovirt.engine.core.common.businessentities.network.Network > asList ( getEntity ( ) ) ) ; model.getNetwork ( ) . setSelectedItem ( getEntity ( ) ) ; model.getNetwork ( ) . setIsChangeable ( false ) ; }

Target:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , getEntity ( ) . getDataCenterId ( ) ) ; setWindow ( model ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile profile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; profile.setNetworkId ( getEntity ( ) . getId ( ) ) ; model.setProfile ( profile ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmWatchdog getWatchdog ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmWatchdog > entities = getBackendCollection ( org.ovirt.engine.core.common.businessentities.VmWatchdog.class , VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmWatchdog current : entities ) { if ( java.util.Objects.equals ( current.getId ( ) , guid ) ) { return current ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmWatchdog getWatchdog ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmWatchdog > entities = getBackendCollection ( org.ovirt.engine.core.common.businessentities.VmWatchdog.class , QueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmWatchdog current : entities ) { if ( java.util.Objects.equals ( current.getId ( ) , guid ) ) { return current ; } } return null ; }
Source:
public void testGroups ( ) { org.ovirt.engine.core.compat.Match match = org.ovirt.engine.core.compat.Regex.Match ( "ABC,123" , "([A-Z]+),([0-9]+)" ) ; assertEquals ( "First Group" , "ABC" , match.Groups ( ) . get ( 0 ) . getValue ( ) ) ; assertEquals ( "Second Group" , "123" , match.Groups ( ) . get ( 1 ) . getValue ( ) ) ; }

Target:
public void testGroups ( ) { org.ovirt.engine.core.compat.Match match = org.ovirt.engine.core.compat.Regex.Match ( "ABC,123" , "([A-Z]+),([0-9]+)" ) ; org.junit.Assert.assertEquals ( "First Group" , "ABC" , match.Groups ( ) . get ( 0 ) . getValue ( ) ) ; org.junit.Assert.assertEquals ( "Second Group" , "123" , match.Groups ( ) . get ( 1 ) . getValue ( ) ) ; }
Source:
public void validateImageNotFound ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateImageNotFound ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }