auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants , org.ovirt.engine.ui.userportal.ApplicationDynamicMessages dynamicMessages ) { userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; domainEditor.setLabel ( constants.loginFormDomainLabel ( ) ) ; connectAutomaticallyEditor.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; motdHeaderLabel.setText ( constants.motdHeaderLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.userportal.ApplicationConstants constants , org.ovirt.engine.ui.userportal.ApplicationDynamicMessages dynamicMessages ) { userNameEditor.setLabel ( constants.loginFormUserNameLabel ( ) ) ; passwordEditor.setLabel ( constants.loginFormPasswordLabel ( ) ) ; profileEditor.setLabel ( constants.loginFormProfileLabel ( ) ) ; connectAutomaticallyEditor.setLabel ( constants.loginFormConnectAutomaticallyLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; motdHeaderLabel.setText ( constants.motdHeaderLabel ( ) ) ; }
Source:
private void assertCorrectSlaveCountInLabeledValidBonds ( int numberOfSlaves , java.lang.String reason , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > valid ) { java.lang.String bondName = "bondName" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( bondName , true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = createGivenCountOfSlavesForBond ( bondName , numberOfSlaves ) ; org.junit.Assert.assertThat ( reason , new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . labeledValidBond ( slaves ) , valid ) ; }

Target:
private void assertCorrectSlaveCountInLabeledValidBondsWhenInsufficientBonds ( int numberOfSlaves ) { java.lang.String bondName = "bondName" ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.IMPROPER_BOND_IS_LABELED , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_BOND_NAME , bondName ) ) ; assertCorrectSlaveCountInLabeledValidBonds ( numberOfSlaves , java.lang.String.format ( "bonded interface with only %1$d slaves is not valid bond" , numberOfSlaves ) , matcher , bondName ) ; }
Source:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
public void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; }
Source:
protected org.ovirt.engine.core.bll.quota.QuotaManager getQuotaManager ( ) { return org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) ; }

Target:
protected long getEngineSessionSeqId ( ) { java.lang.String sessionId = getParameters ( ) . getSessionId ( ) ; if ( ( sessionId == null ) && ( ( getContext ( ) ) != null ) ) { sessionId = getContext ( ) . getEngineContext ( ) . getSessionId ( ) ; } if ( sessionId == null ) { throw new java.lang.RuntimeException ( ( "No sessionId found for command " + ( getClass ( ) . getName ( ) ) ) ) ; } return org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . getEngineSessionSeqId ( sessionId ) ; }
Source:
public void copyFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { setId ( brick.getId ( ) ) ; setVolumeId ( brick.getVolumeId ( ) ) ; setServerId ( brick.getServerId ( ) ) ; setServerName ( brick.getServerName ( ) ) ; setBrickDirectory ( brick.getBrickDirectory ( ) ) ; setBrickOrder ( brick.getBrickOrder ( ) ) ; setStatus ( brick.getStatus ( ) ) ; }

Target:
public void copyFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { setId ( brick.getId ( ) ) ; setVolumeId ( brick.getVolumeId ( ) ) ; setServerId ( brick.getServerId ( ) ) ; setServerName ( brick.getServerName ( ) ) ; setBrickDirectory ( brick.getBrickDirectory ( ) ) ; setBrickOrder ( brick.getBrickOrder ( ) ) ; setUnSyncedEntries ( brick.unSyncedEntries ) ; setUnSyncedEntriesTrend ( brick.getUnSyncedEntriesTrend ( ) ) ; setStatus ( brick.getStatus ( ) ) ; setIsArbiter ( brick.getIsArbiter ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > getCinderDisksToBeRemoved ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > imageDisks = org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . cinderDisks ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = new java.util.ArrayList < > ( ) ; if ( imageDisks == null ) { cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDiskBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getVmId ( ) ) ) ; } else { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : imageDisks ) { cinderDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( diskImage ) ) ) ; } } return cinderDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > getCinderDisksToBeRemoved ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > imageDisks = org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . cinderDisks ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = new java.util.ArrayList < > ( ) ; if ( imageDisks == null ) { cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getVmId ( ) ) ) ; } else { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : imageDisks ) { cinderDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( diskImage ) ) ) ; } } return cinderDisks ; }
Source:
public static void GetLocalFSPath ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath ) , aQuery ) ; }

Target:
public static void GetLocalFSPath ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void coresPerSocketChanged ( ) { int coresPerSocket = extractIntFromListModel ( getModel ( ) . getCoresPerSocket ( ) ) ; int totalCpuCores = getTotalCpuCores ( ) ; if ( ( coresPerSocket == 0 ) || ( totalCpuCores == 0 ) ) { return ; } getModel ( ) . getNumOfSockets ( ) . setSelectedItem ( ( totalCpuCores / coresPerSocket ) ) ; }

Target:
public void numOfSocketChanged ( ) { final int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; final int totalCpuCores = getTotalCpuCores ( ) ; if ( ( numOfSockets == 0 ) || ( totalCpuCores == 0 ) ) { return ; } getModel ( ) . getThreadsPerCore ( ) . setSelectedItem ( 1 ) ; getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( ( totalCpuCores / numOfSockets ) ) ; setCpuChangeability ( ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewCommand ( ) ) ) { return newProfilePopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) { return editProfilePopupProvider.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.storage.StorageEventListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getDetailsCommand ( ) ) ) { return eventPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public void run ( ) { try { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ApproveVds , params ) ; if ( ( ret == null ) || ( ! ( ret.getSucceeded ( ) ) ) ) { log.errorFormat ( "Approval of oVirt {0} failed. " , params.getVdsId ( ) ) ; } else if ( ret.getSucceeded ( ) ) { log.infoFormat ( "Approval of oVirt {0} ended successefully. " , params.getVdsId ( ) ) ; } } catch ( java.lang.RuntimeException ex ) { log.error ( "Failed to Approve host" , ex ) ; } }

Target:
public void run ( ) { try { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ApproveVds , params ) ; if ( ( ret == null ) || ( ! ( ret.getSucceeded ( ) ) ) ) { log.errorFormat ( "Approval of oVirt {0} failed. " , params.getVdsId ( ) ) ; } else if ( ret.getSucceeded ( ) ) { log.infoFormat ( "Approval of oVirt {0} ended successfully. " , params.getVdsId ( ) ) ; } } catch ( java.lang.RuntimeException ex ) { log.error ( "Failed to Approve host" , ex ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel vmInterfaceListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateInterfaceListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > network_list = ( returnValue != null ) ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ) ( returnValue ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ( ) ; vmInterfaceListModel.PostGetClusterNetworkList_Edit ( network_list ) ; }

Target:
public void OnSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; isLinkStateChangeable = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.NetworkLinkingSupported , cluster.getcompatibility_version ( ) . getValue ( ) ) ) ) ; UpdateActionAvailability ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult interfaceInHost ( org.ovirt.engine.core.compat.Guid hostId ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NIC_NOT_EXISTS_ON_HOST , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NIC_NOT_EXISTS_ON_HOST_ENTITY , hostId.toString ( ) ) ) . when ( ( ! ( iface.getVdsId ( ) . equals ( hostId ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult interfaceInHost ( org.ovirt.engine.core.compat.Guid hostId ) { final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NIC_NOT_EXISTS_ON_HOST ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , hostId.toString ( ) ) ) . when ( ( ! ( iface.getVdsId ( ) . equals ( hostId ) ) ) ) ; }
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 ( getSnapshotsValidator ( ) . 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.isVmInUpPausedDownStatus ( ) ) ) && ( isDiskExist ( disk ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ; }
Source:
public static void GetLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters tempVar = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( ) ; tempVar.setVgId ( vgId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , tempVar , aQuery ) ; }

Target:
public static void GetLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
private void MoveVdssToGoingToMaintananceMode ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > spms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdssToMaintenance.values ( ) ) { if ( ( vds.getspm_status ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.SPM ) ) { setVdsStatusToPrepareForMaintaice ( vds ) ; } else { spms.add ( vds ) ; } } for ( org.ovirt.engine.core.common.businessentities.VDS vds : spms ) { setVdsStatusToPrepareForMaintaice ( vds ) ; } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.freeLock ( ) ; }

Target:
private void MoveVdssToGoingToMaintananceMode ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > spms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : vdssToMaintenance.values ( ) ) { if ( ( vds.getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.SPM ) ) { setVdsStatusToPrepareForMaintaice ( vds ) ; } else { spms.add ( vds ) ; } } for ( org.ovirt.engine.core.common.businessentities.VDS vds : spms ) { setVdsStatusToPrepareForMaintaice ( vds ) ; } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.freeLock ( ) ; }
Source:
private boolean localStorageEnabled ( org.ovirt.engine.api.model.Version version ) { return getConfigurationValue ( java.lang.Boolean.class , ConfigurationValues.LocalStorageEnabled , version ) ; }

Target:
private void addReportedDeviceTypes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.ReportedDeviceType [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_2 ) ) { version.setReportedDeviceTypes ( new org.ovirt.engine.api.model.ReportedDeviceTypes ( ) ) ; for ( org.ovirt.engine.api.model.ReportedDeviceType reportedDeviceType : values ) { version.getReportedDeviceTypes ( ) . getReportedDeviceTypes ( ) . add ( reportedDeviceType.value ( ) ) ; } } }
Source:
public void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getAuthzGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void testFilter ( ) throws org.apache.xmlrpc.XmlRpcException { proxy.filter ( ) ; }

Target:
public void testFilter ( ) throws org.apache.xmlrpc.XmlRpcException { java.util.List < java.lang.String > result = proxy.filter ( new java.lang.String [ ] { org.ovirt.schedulerproxy.SchedulerProxyTest.FILE_NAME } , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID , "" ) ; org.junit.Assert.assertTrue ( ( ( result.size ( ) ) == 2 ) ) ; org.junit.Assert.assertTrue ( result.contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID1 ) ) ; org.junit.Assert.assertTrue ( result.contains ( org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ID2 ) ) ; }
Source:
public void testIsFieldsUpdated ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; boolean changed = oic.IsFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "name" ) ) ; assertFalse ( "No Change" , changed ) ; changed = oic.IsFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "saberColor" ) ) ; assertTrue ( "1 Change" , changed ) ; }

Target:
public void testIsFieldsUpdated ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; boolean changed = oic.IsFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "name" ) ) ; org.junit.Assert.assertFalse ( "No Change" , changed ) ; changed = oic.IsFieldsUpdated ( jedi1 , jedi2 , java.util.Arrays.asList ( "saberColor" ) ) ; org.junit.Assert.assertTrue ( "1 Change" , changed ) ; }
Source:
java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesForVm ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice graphics : getDevicesOfType ( VmDeviceGeneralType.GRAPHICS ) ) { graphicsTypes.add ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromVmDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType.getByName ( graphics.getDevice ( ) ) ) ) ; } return graphicsTypes ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksDummies ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksDummies = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getParameters ( ) . getImageToDestinationDomainMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageDomainId ) ) ) ; disksDummies.add ( diskImage ) ; } return disksDummies ; }
Source:
private void saveNfsStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . StartProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveNfs" } ) ) ) . Run ( ) ; }

Target:
private void savePosixStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SavePosix" } ) ) ) . Run ( ) ; }
Source:
private static java.lang.Integer getIpv6Prefix ( java.lang.String ipv6Address ) { if ( ipv6Address != null ) { final java.lang.String [ ] addressFractions = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.IPV6_ADDRESS_SPLIT_PATTERN.split ( ipv6Address ) ; if ( ( addressFractions.length ) == 2 ) { try { return java.lang.Integer.valueOf ( addressFractions [ 1 ] ) ; } catch ( java.lang.NumberFormatException e ) { return null ; } } } return null ; }

Target:
static java.lang.Integer extractIpv6Prefix ( java.lang.String ipv6Address ) { if ( ipv6Address == null ) { return null ; } final java.util.regex.Matcher matcher = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.IPV6_ADDRESS_CAPTURE_PREFIX_PATTERN.matcher ( ipv6Address ) ; if ( matcher.matches ( ) ) { final java.lang.String prefixString = matcher.group ( 1 ) ; return java.lang.Integer.valueOf ( prefixString ) ; } return null ; }
Source:
private void InternalEndSuccessfully ( ) { log.infoFormat ( "Ending command successfully: {0}" , getClass ( ) . getName ( ) ) ; EndSuccessfully ( ) ; }

Target:
private void internalEndSuccessfully ( ) { log.infoFormat ( "Ending command successfully: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endSuccessfully ( ) ; getParameters ( ) . incrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) < ( getTaskHandlers ( ) . size ( ) ) ) { _actionState = CommandActionState.EXECUTE ; execute ( ) ; } } else { endSuccessfully ( ) ; } }
Source:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }

Target:
private void initStoragePool ( ) { storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; command.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storagePool ) ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; getSearchCommand ( ) . execute ( ) ; }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolumeEntity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ; setItems ( glusterVolumeEntity.getBricks ( ) ) ; } else { setItems ( null ) ; } }
Source:
protected void updateData ( ) { java.util.List < T > items = ( ( java.util.List < T > ) ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) ) ; if ( items != null ) { updateDataProvider ( items ) ; } }

Target:
protected void updateData ( ) { java.util.List < T > items = ( ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) == null ) ? null : new java.util.ArrayList < T > ( ( ( java.util.Collection < T > ) ( org.ovirt.engine.ui.common.uicommon.model.DataBoundTabModelProvider.getModel ( ) . getItems ( ) ) ) ) ; if ( items != null ) { updateDataProvider ( items ) ; } }
Source:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( QueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( QueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void testValidateQuota ( ) { cmd.validateQuota ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.verify ( quotaValidator , org.mockito.Mockito.times ( 1 ) ) . isValid ( ) ; org.mockito.Mockito.verify ( quotaValidator , org.mockito.Mockito.times ( 1 ) ) . isDefinedForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void testValidateQuota ( ) { org.mockito.Mockito.doReturn ( quotaValidator ) . when ( cmd ) . createQuotaValidator ( org.mockito.ArgumentMatchers.any ( ) ) ; cmd.validateQuota ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.verify ( quotaValidator , org.mockito.Mockito.times ( 1 ) ) . isValid ( ) ; org.mockito.Mockito.verify ( quotaValidator , org.mockito.Mockito.times ( 1 ) ) . isDefinedForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void setup ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( eventQueue ) . when ( cmd ) . getEventQueue ( ) ; }

Target:
public void setup ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand < org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase > ( params ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( eventQueue ) . when ( cmd ) . getEventQueue ( ) ; }
Source:
private org.ovirt.engine.core.common.queries.VdcQueryReturnValue createVmQueryResult ( ) { final org.ovirt.engine.core.common.queries.VdcQueryReturnValue v = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; list.add ( createVM ( ) ) ; v.setReturnValue ( list ) ; v.setSucceeded ( true ) ; return v ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { return java.util.Collections.singletonList ( createVM ( ) ) ; }
Source:
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 ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public boolean equals ( org.ovirt.engine.ui.uicompat.EventDefinition other ) { if ( other == null ) { return false ; } return ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( getName ( ) , other.getName ( ) ) ) && ( ( getOwnerType ( ) ) == ( other.getOwnerType ( ) ) ) ; }

Target:
public boolean matchesDefinition ( org.ovirt.engine.ui.uicompat.EventDefinition other ) { if ( other == null ) { return false ; } return ( getName ( ) . equals ( other.getName ( ) ) ) && ( ( getOwnerType ( ) ) == ( other.getOwnerType ( ) ) ) ; }
Source:
private boolean isBalloonActiveOnHost ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getDbFacade ( ) . getVdsGroupDao ( ) . get ( vds.getVdsGroupId ( ) ) ; return ( cluster != null ) && ( cluster.isEnableBallooning ( ) ) ; }

Target:
private void saveVmNumaNodeRuntimeData ( ) { if ( ! ( vmStatisticsToSave.isEmpty ( ) ) ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > vmNumaNodesToUpdate = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatistics vmStats : vmStatisticsToSave.values ( ) ) { vmNumaNodesToUpdate.addAll ( vmStats.getvNumaNodeStatisticsList ( ) ) ; } if ( ! ( vmNumaNodesToUpdate.isEmpty ( ) ) ) { getDbFacade ( ) . getVmNumaNodeDAO ( ) . massUpdateVmNumaNodeRuntimePinning ( vmNumaNodesToUpdate ) ; } } }
Source:
public void testListCrash ( ) { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage object ) { return object.getDiskInterface ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage object ) { if ( ( object.getDiskVmElements ( ) . size ( ) ) == 1 ) { return object.getDiskVmElements ( ) . iterator ( ) . next ( ) . getDiskInterface ( ) ; } return null ; }
Source:
public void testAllocateMacFromRequestForStatelessVmWhenDivergingFromSnapshot ( ) { nicBeingUpdated.setMacAddress ( org.ovirt.engine.core.bll.network.vm.OLD_MAC ) ; updatingNic.setMacAddress ( org.ovirt.engine.core.bll.network.vm.NEW_MAC ) ; mockOriginalSnapshot ( org.ovirt.engine.core.bll.network.vm.OLD_MAC , org.ovirt.engine.core.bll.network.vm.OTHER_MAC ) ; org.mockito.Mockito.when ( macPool.addMac ( updatingNic.getMacAddress ( ) ) ) . thenReturn ( true ) ; underTest.initMacPoolData ( ) ; org.junit.Assert.assertThat ( "New mac value of nic being updated is different as one in snapshot, thus is has to be allocated" , underTest.allocateMacFromRequest ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testAllocateMacFromRequestForStatelessVmWhenDivergingFromSnapshot ( ) { nicBeingUpdated.setMacAddress ( org.ovirt.engine.core.bll.network.vm.OLD_MAC ) ; updatingNic.setMacAddress ( org.ovirt.engine.core.bll.network.vm.NEW_MAC ) ; mockOriginalSnapshot ( org.ovirt.engine.core.bll.network.vm.OLD_MAC , org.ovirt.engine.core.bll.network.vm.OTHER_MAC ) ; org.mockito.Mockito.when ( macPool.addMac ( updatingNic.getMacAddress ( ) ) ) . thenReturn ( true ) ; underTest.initMacPoolData ( ) ; org.hamcrest.MatcherAssert.assertThat ( "New mac value of nic being updated is different as one in snapshot, thus is has to be allocated" , underTest.allocateMacFromRequest ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
boolean areRequiredNetworksAvailable ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmNetworkInterfaces , final java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allInterfacesForVds ) { for ( final org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIf : vmNetworkInterfaces ) { boolean found = false ; for ( final org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vdsIf : allInterfacesForVds ) { if ( org.apache.commons.lang.StringUtils.equals ( vmIf.getNetworkName ( ) , vdsIf.getNetworkName ( ) ) ) { found = true ; break ; } } if ( ! found ) { return false ; } } return true ; }

Target:
boolean areRequiredNetworksAvailable ( org.ovirt.engine.core.compat.Guid vdsId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allInterfacesForVds = getInterfaceDAO ( ) . getAllInterfacesForVds ( vdsId ) ; for ( final org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIf : getVmNICs ( ) ) { boolean found = false ; for ( final org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vdsIf : allInterfacesForVds ) { if ( org.apache.commons.lang.StringUtils.equals ( vmIf.getNetworkName ( ) , vdsIf.getNetworkName ( ) ) ) { found = true ; break ; } } if ( ! found ) { return false ; } } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( diskId ) ; java.util.Collections.singletonList ( storageId ) ; disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageId ) ) ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( diskId ) ; java.util.Collections.singletonList ( storageId ) ; disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageId ) ) ) ; return disk ; }
Source:
public void testGetAllVMSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "VM" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vmResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllVMTemplatesSearch ( ) throws java.lang.Exception { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Template" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.VmTemplate ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vmTemplateResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
protected void extractBondIfModified ( java.util.Set < java.lang.String > bonds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String name ) { if ( org.apache.commons.lang.StringUtils.isBlank ( iface.getNetworkName ( ) ) ) { violations.add ( VdcBllMessages.NETWROK_NOT_EXISTS ) ; } else { if ( bonds.contains ( name ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { bonds.add ( name ) ; if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( name , iface ) ; } } } }

Target:
private boolean addInterfaceToProcessedList ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { if ( isBond ( iface ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { violations.add ( VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE ) ; } return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }