auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void updateItemsAvailability ( ) { if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getQueryStartedEvent ( ) . getListeners ( ) . contains ( this ) ) ) org.ovirt.engine.ui.frontend.Frontend.getQueryStartedEvent ( ) . addListener ( this ) ; if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getQueryCompleteEvent ( ) . getListeners ( ) . contains ( this ) ) ) org.ovirt.engine.ui.frontend.Frontend.getQueryCompleteEvent ( ) . addListener ( this ) ; }

Target:
public void updateItemsAvailability ( ) { if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getQueryStartedEvent ( ) . getListeners ( ) . contains ( this ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getQueryStartedEvent ( ) . addListener ( this ) ; } if ( ! ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getQueryCompleteEvent ( ) . getListeners ( ) . contains ( this ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getQueryCompleteEvent ( ) . addListener ( this ) ; } }
Source:
public void canRunVmDuringInit ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }

Target:
public void canRunVmDuringInit ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
public void attestationServerConfigured ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void attestationServerConfigured ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void shouldScheduleRegularInterval ( ) { org.mockito.Mockito.verify ( scheduler ) . scheduleAFixedDelayJob ( org.mockito.ArgumentMatchers.anyObject ( ) , org.mockito.ArgumentMatchers.eq ( "refresh" ) , org.mockito.ArgumentMatchers.eq ( new java.lang.Class [ ] { } ) , org.mockito.ArgumentMatchers.eq ( new java.lang.Object [ ] { } ) , org.mockito.ArgumentMatchers.eq ( 1L ) , org.mockito.ArgumentMatchers.anyLong ( ) , org.mockito.ArgumentMatchers.eq ( java.util.concurrent.TimeUnit.MINUTES ) ) ; }

Target:
public void shouldScheduleRegularInterval ( ) { org.mockito.Mockito.verify ( scheduler ) . scheduleAFixedDelayJob ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( "refresh" ) , org.mockito.ArgumentMatchers.eq ( new java.lang.Class [ ] { } ) , org.mockito.ArgumentMatchers.eq ( new java.lang.Object [ ] { } ) , org.mockito.ArgumentMatchers.eq ( 1L ) , org.mockito.ArgumentMatchers.anyLong ( ) , org.mockito.ArgumentMatchers.eq ( java.util.concurrent.TimeUnit.MINUTES ) ) ; }
Source:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dao.VdsDynamicDao vdsDynamicDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic hostFromDb = vdsDynamicDao.get ( getVds ( ) . getId ( ) ) ; hostFromDb.setSupportedClusterLevels ( getVds ( ) . getDynamicData ( ) . getSupportedClusterLevels ( ) ) ; vdsDynamicDao.update ( hostFromDb ) ; }

Target:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic hostFromDb = vdsDynamicDao.get ( getVds ( ) . getId ( ) ) ; hostFromDb.setSupportedClusterLevels ( getVds ( ) . getDynamicData ( ) . getSupportedClusterLevels ( ) ) ; vdsDynamicDao.update ( hostFromDb ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getLoginCommand ( ) ) ) { login ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getLoginCommand ( ) ) ) { login ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel poolInterfaceListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel ) ( model ) ) ; poolInterfaceListModel.SyncSearch ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vm.getId ( ) ) ) ; } }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel poolInterfaceListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel ) ( model ) ) ; poolInterfaceListModel.SyncSearch ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ) ; } }
Source:
private org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks ) { org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters ( ) ; createParams.setCinderDisks ( cinderDisks ) ; createParams.setParentHasTasks ( isContainImages ( ) ) ; createParams.setParentCommand ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getActionType ( ) ) ; createParams.setParentParameters ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) ) ; return createParams ; }

Target:
private org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks ) { org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.RemoveAllVmCinderDisksParameters ( ) ; createParams.setCinderDisks ( cinderDisks ) ; createParams.setParentCommand ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getActionType ( ) ) ; createParams.setParentParameters ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) ) ; return createParams ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction getGlusterSwiftAction ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServiceStatus currentStatus , boolean isStart , boolean isStop , boolean isRestart ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction action = null ; if ( isStart ) { action = org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction.START ; } else if ( isStop ) { action = org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction.STOP ; } else if ( isRestart ) { action = org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction.RESTART ; } return action ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction getGlusterSwiftAction ( boolean isStart , boolean isStop , boolean isRestart ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction action = null ; if ( isStart ) { action = org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction.START ; } else if ( isStop ) { action = org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction.STOP ; } else if ( isRestart ) { action = org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel.GlusterSwiftAction.RESTART ; } return action ; }
Source:
public void testDeleteUnregisteredEntity ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( ( ( ovfEntityDataList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertFalse ( ovfEntityDataList.isEmpty ( ) ) ; dao.removeEntity ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList2 = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( ovfEntityDataList2.isEmpty ( ) ) ; }

Target:
public void testDeleteUnregisteredEntity ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertEquals ( 1 , ovfEntityDataList.size ( ) ) ; org.junit.Assert.assertFalse ( ovfEntityDataList.isEmpty ( ) ) ; dao.removeEntity ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList2 = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( ovfEntityDataList2.isEmpty ( ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.cell.ImageResourceCell.template.imageContainerWithStyleClass ( style , styleClass , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( value != null ) { sb.append ( template.imageContainerWithStyleClass ( id , style , styleClass , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }
Source:
public static void GetDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void GetDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetwork ( ) { if ( ( glusterNetwork ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getClusterId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( network.getCluster ( ) . isGluster ( ) ) { glusterNetwork = network ; return glusterNetwork ; } } } return glusterNetwork ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetwork ( ) { if ( ( glusterNetwork ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getClusterId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( network.getCluster ( ) . isGluster ( ) ) { glusterNetwork = network ; return glusterNetwork ; } } } return glusterNetwork ; }
Source:
private boolean isDiskExistInVm ( org.ovirt.engine.core.common.businessentities.Disk disk ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( vm.getId ( ) . equals ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ) { return true ; } } return false ; }

Target:
private boolean isDiskExistInVm ( org.ovirt.engine.core.common.businessentities.Disk disk ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( vm.getId ( ) . equals ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ) { return true ; } } return false ; }
Source:
protected void setUpUpdateExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetConsoleExpectations ( new int [ ] { 0 } ) ; setUpGetVirtioScsiExpectations ( new int [ ] { 0 } ) ; setUpGetSoundcardExpectations ( new int [ ] { 0 } ) ; setUpGetRngDeviceExpectations ( new int [ ] { 0 } ) ; }

Target:
protected void setUpUpdateExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetConsoleExpectations ( 0 ) ; setUpGetVirtioScsiExpectations ( 0 ) ; setUpGetSoundcardExpectations ( 0 ) ; setUpGetRngDeviceExpectations ( 0 ) ; }
Source:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( status ) ; } if ( ! valid ) { if ( status.isStorageDomainInProcess ( ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }

Target:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( status ) ; } if ( ! valid ) { if ( ( status != null ) && ( status.isStorageDomainInProcess ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getEnableKsm ( ) . getEntity ( ) ) == null ) { return ; } if ( ( getEnableKsm ( ) . getEntity ( ) ) == true ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( true ) ; } if ( ( getEnableKsm ( ) . getEntity ( ) ) == false ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getEnableKsm ( ) . getEntity ( ) ) == null ) { return ; } if ( getEnableKsm ( ) . getEntity ( ) ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( true ) ; } if ( ! ( getEnableKsm ( ) . getEntity ( ) ) ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( false ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterNetworkProviders ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ) ) ; networkModel.getExternalProviders ( ) . setItems ( providers ) ; networkModel.getExternalProviders ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( providers ) ) ; networkModel.stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; networkModel.getExternalProviders ( ) . setItems ( providers ) ; networkModel.getExternalProviders ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( providers ) ) ; networkModel.stopProgress ( ) ; }
Source:
public void validateFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; setUpMocksForAdd ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }

Target:
public void validateFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; setUpMocksForAdd ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }
Source:
private static java.lang.String [ ] createIncoherentIdentificationErrorReplacements ( java.lang.String violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName ) { return new java.lang.String [ ] { java.lang.String.format ( "$referrerId %s" , violatingEntityId ) , java.lang.String.format ( "$referringId %s" , referringId ) , java.lang.String.format ( "$referringName %s" , referringName ) } ; }

Target:
private java.lang.String [ ] createIncoherentIdentificationErrorReplacements ( java.lang.String violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName ) { return new java.lang.String [ ] { java.lang.String.format ( "$referrerId %s" , violatingEntityId ) , java.lang.String.format ( "$referringId %s" , referringId ) , java.lang.String.format ( "$referringName %s" , referringName ) } ; }
Source:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void testConvertTiBToYiB ( ) { double tib = 100 * ( java.lang.Math.pow ( 1024 , 4 ) ) ; int yib = org.ovirt.engine.core.common.utils.SizeConverter.convert ( ( ( long ) ( tib ) ) , SizeUnit.TiB , SizeUnit.YiB ) . intValue ( ) ; org.junit.Assert.assertEquals ( yib , 100 ) ; }

Target:
public void testConvertTiBToYiB ( ) { double tib = 100 * ( java.lang.Math.pow ( 1024 , 4 ) ) ; int yib = org.ovirt.engine.core.common.utils.SizeConverter.convert ( ( ( long ) ( tib ) ) , SizeUnit.TiB , SizeUnit.YiB ) . intValue ( ) ; org.junit.Assert.assertEquals ( 100 , yib ) ; }
Source:
protected org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters param = new org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters ( vmPools , testVm , VM_COUNT , DISK_SIZE ) ; param.setStorageDomainId ( firstStorageDomainId ) ; org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param , org.ovirt.engine.core.bll.context.CommandContext.createContext ( param.getSessionId ( ) ) ) { @ java.lang.Override protected void initUser ( ) { } @ java.lang.Override protected void initTemplate ( ) { } } ) ; return command ; }

Target:
protected org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters param = new org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters ( vmPools , testVm , VM_COUNT ) ; param.setStorageDomainId ( firstStorageDomainId ) ; org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.AddVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters > ( param , org.ovirt.engine.core.bll.context.CommandContext.createContext ( param.getSessionId ( ) ) ) { @ java.lang.Override protected void initUser ( ) { } @ java.lang.Override protected void initTemplate ( ) { } } ) ; return command ; }
Source:
private void addVnicProfile ( org.ovirt.engine.core.common.businessentities.network.Network network , boolean publicUse ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setName ( network.getName ( ) ) ; vnicProfile.setNetworkId ( network.getId ( ) ) ; org.ovirt.engine.core.common.action.AddVnicProfileParameters parameters = new org.ovirt.engine.core.common.action.AddVnicProfileParameters ( vnicProfile ) ; parameters.setPublicUse ( publicUse ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AddVnicProfile , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; }

Target:
private void addVnicProfile ( org.ovirt.engine.core.common.businessentities.network.Network network , boolean publicUse ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setName ( network.getName ( ) ) ; vnicProfile.setNetworkId ( network.getId ( ) ) ; org.ovirt.engine.core.common.action.AddVnicProfileParameters parameters = new org.ovirt.engine.core.common.action.AddVnicProfileParameters ( vnicProfile , true ) ; parameters.setPublicUse ( publicUse ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AddVnicProfile , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; }
Source:
protected void analyze ( ) { proceedDownVms ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedGuaranteedMemoryCheck ( ) ; updateRepository ( ) ; prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; updateVmJobs ( ) ; analyzeExternalVms ( ) ; analyzeHostedEngineVm ( ) ; if ( ( vmDynamicToSave ) != null ) { vmsMonitoring.addVmDynamicToList ( vmDynamicToSave ) ; } if ( saveStatistics ) { vmsMonitoring.addVmStatisticsToList ( dbVm.getStatisticsData ( ) ) ; } if ( saveVmInterfaces ) { vmsMonitoring.addVmInterfaceStatisticsToList ( dbVm.getInterfaces ( ) ) ; } }

Target:
protected void analyze ( ) { proceedDownVms ( ) ; proceedWatchdogEvents ( ) ; proceedBalloonCheck ( ) ; proceedGuaranteedMemoryCheck ( ) ; updateRepository ( ) ; prepareGuestAgentNetworkDevicesForUpdate ( ) ; updateLunDisks ( ) ; updateVmJobs ( ) ; analyzeExternalVms ( ) ; analyzeHostedEngineVm ( ) ; if ( ( vmDynamicToSave ) != null ) { vmsMonitoring.addVmDynamicToList ( vmDynamicToSave ) ; } if ( saveVmInterfaces ) { vmsMonitoring.addVmInterfaceStatisticsToList ( dbVm.getInterfaces ( ) ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.storage_domains expectGetStorageDomain ( org.ovirt.engine.core.compat.Guid domId , org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.dao.StorageDomainDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( db.getStorageDomainDao ( ) ) . thenReturn ( dao ) ; org.ovirt.engine.core.common.businessentities.storage_domains dom = getStorageDomain ( domId , poolId , type , storageType ) ; org.mockito.Mockito.when ( dao.getForStoragePool ( domId , poolId ) ) . thenReturn ( dom ) ; return dom ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain expectGetStorageDomain ( org.ovirt.engine.core.compat.Guid domId , org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.dao.StorageDomainDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( db.getStorageDomainDao ( ) ) . thenReturn ( dao ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dom = getStorageDomain ( domId , poolId , type , storageType ) ; org.mockito.Mockito.when ( dao.getForStoragePool ( domId , poolId ) ) . thenReturn ( dom ) ; return dom ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < Q > qosList = ( ( java.util.ArrayList < Q > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; qosMap = new java.util.HashMap < > ( ) ; if ( qosList != null ) { for ( Q qos : qosList ) { qosMap.put ( qos.getId ( ) , qos ) ; } } fetchProfiles ( ) ; }

Target:
public void onSuccess ( java.lang.Object returnValue ) { java.util.List < Q > qosList = ( ( java.util.ArrayList < Q > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; qosMap = new java.util.HashMap < > ( ) ; if ( qosList != null ) { for ( Q qos : qosList ) { qosMap.put ( qos.getId ( ) , qos ) ; } } fetchProfiles ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.hosts = hosts ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; clusterGuideModel.hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkVlanOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , ( ( iface.getVlanId ( ) ) + 1 ) , createQos ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkVlanOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.isBridged ( ) , iface.getMtu ( ) , ( ( iface.getVlanId ( ) ) + 1 ) , createQos ( ) ) ; }
Source:
public void setVmsWithvNumaNodeList ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsWithvNumaNodeList ) { super . setVmsWithvNumaNodeList ( vmsWithvNumaNodeList ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vm.getId ( ) ) ) { vmsWithvNumaNodeList.add ( vm ) ; } else { org.ovirt.engine.core.common.businessentities.VM removeVm = null ; for ( org.ovirt.engine.core.common.businessentities.VM iterVm : vmsWithvNumaNodeList ) { if ( iterVm.getId ( ) . equals ( vm.getId ( ) ) ) { removeVm = iterVm ; break ; } } vmsWithvNumaNodeList.remove ( removeVm ) ; vmsWithvNumaNodeList.add ( vm ) ; } }

Target:
public void setVmsWithvNumaNodeList ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsWithvNumaNodeList ) { super . setVmsWithvNumaNodeList ( vmsWithvNumaNodeList ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vm.getId ( ) ) ) { vmsWithvNumaNodeList.add ( vm ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachmentWithIpv4Configuration ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol bootProtocol , java.lang.String address , java.lang.String netmask ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setAddress ( address ) ; primaryAddress.setNetmask ( netmask ) ; primaryAddress.setBootProtocol ( bootProtocol ) ; ipConfiguration.getIPv4Addresses ( ) . add ( primaryAddress ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( ipConfiguration ) ; return attachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachmentWithIpv4Configuration ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol bootProtocol ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryAddress = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryAddress.setAddress ( null ) ; primaryAddress.setNetmask ( null ) ; primaryAddress.setBootProtocol ( bootProtocol ) ; ipConfiguration.getIPv4Addresses ( ) . add ( primaryAddress ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( ipConfiguration ) ; return attachment ; }
Source:
public org.ovirt.optimizer.config.ConfigProvider load ( ) { java.io.FileReader reader = null ; try { reader = new java.io.FileReader ( configFile ) ; config.load ( reader ) ; } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.warn ( "Config file could not be opened. Using the defaults values with server: {}." , configFile , config.getProperty ( org.ovirt.optimizer.config.ConfigProvider.SDK_SERVER ) ) ; } finally { try { if ( reader != null ) { reader.close ( ) ; } } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.error ( "The config file could not be closed" , ex ) ; } } return this ; }

Target:
public org.ovirt.optimizer.config.ConfigProvider load ( ) { try ( java.io.FileReader reader = new java.io.FileReader ( configFile ) ) { config.load ( reader ) ; } catch ( java.io.IOException ex ) { org.ovirt.optimizer.config.ConfigProvider.log.warn ( "Config file could not be opened. Using the defaults values with server: {}." , configFile , config.getProperty ( org.ovirt.optimizer.config.ConfigProvider.SDK_SERVER ) ) ; } return this ; }
Source:
public void put ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status , boolean enableCallBack ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = buildCommandEntity ( commandId , rootCommandId , actionType , params , status , enableCallBack ) ; commandMap.put ( commandId , cmdEntity ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; }

Target:
public void put ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { commandMap.put ( cmdEntity.getId ( ) , cmdEntity ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) ) ; setupMocks ( ) ; org.mockito.Mockito.doNothing ( ) . when ( hookSyncJob ) . refreshHooksInCluster ( getCluster ( ) , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REFRESH ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) , null ) ) ; setupMocks ( ) ; org.mockito.Mockito.doNothing ( ) . when ( hookSyncJob ) . refreshHooksInCluster ( getCluster ( ) , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REFRESH ) ; }
Source:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > allClusters = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; clusterArchitecturesInDataCenters = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : allClusters ) { if ( ( cluster.supportsVirtService ( ) ) && ( ( cluster.getArchitecture ( ) ) != null ) ) { addArchitecture ( cluster.getStoragePoolId ( ) , cluster.getArchitecture ( ) ) ; } } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > allClusters = returnValue.getReturnValue ( ) ; clusterArchitecturesInDataCenters = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : allClusters ) { if ( ( cluster.supportsVirtService ( ) ) && ( ( cluster.getArchitecture ( ) ) != null ) ) { addArchitecture ( cluster.getStoragePoolId ( ) , cluster.getArchitecture ( ) ) ; } } }
Source:
protected org.ovirt.engine.core.common.businessentities.VdsNetworkInterface map ( org.ovirt.engine.api.model.HostNIC entity , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface template ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = super . map ( entity , template ) ; if ( entity.isSetNetwork ( ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( entity.getNetwork ( ) ) ; iface.setNetworkName ( net.getname ( ) ) ; } return iface ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface map ( org.ovirt.engine.api.model.HostNIC entity , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface template ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = super . map ( entity , template ) ; if ( entity.isSetNetwork ( ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( entity.getNetwork ( ) ) ; iface.setNetworkName ( net.getName ( ) ) ; } return iface ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getParameters ( ) . getClusterId ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID ) ; return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.VDS > servers = getAllUpServers ( getParameters ( ) . getClusterId ( ) ) ; if ( ( servers == null ) || ( servers.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( getAllUpServers ( ) ) == null ) || ( getAllUpServers ( ) . isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }
Source:
protected void initStoragePoolId ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { setStoragePoolId ( ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getstorage_pool_id ( ) ) != null ? org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getstorage_pool_id ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ; } }

Target:
protected void initStoragePoolId ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { setStoragePoolId ( ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getStoragePoolId ( ) ) != null ? org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getStoragePoolId ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ; } }
Source:
protected void setAllowChangeHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) { getHost ( ) . setIsChangable ( false ) ; getPort ( ) . setIsChangable ( false ) ; getFetchSshFingerprint ( ) . setIsChangable ( false ) ; } else { getHost ( ) . setIsChangable ( true ) ; getPort ( ) . setIsChangable ( true ) ; getFetchSshFingerprint ( ) . setIsChangable ( true ) ; } }

Target:
protected void setAllowChangeHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) { getHost ( ) . setIsChangable ( false ) ; } else { getHost ( ) . setIsChangable ( true ) ; } }
Source:
private void expectGetConnections ( ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS.length ) ; i ++ ) { org.mockito.Mockito.when ( storageServerConnectionDao.get ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.setUpConnection ( i ) ) ; } }

Target:
private void expectGetConnections ( ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS.length ) ; i ++ ) { org.mockito.Mockito.when ( storageServerConnectionDao.get ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] ) ) . thenReturn ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.setUpConnection ( i ) ) ; } }
Source:
protected void updateOptionsRequiredAddDataCenter ( boolean enableButton ) { if ( enableButton ) { org.ovirt.engine.ui.uicommonweb.UICommand addDataCenterAction = new org.ovirt.engine.ui.uicommonweb.UICommand ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel.ADD_DATA_CENTER , this ) ; addDataCenterAction.setTitle ( addDataCenterTitle ) ; addDataCenterAction.setIsAvailable ( enableButton ) ; getOptionalActions ( ) . add ( addDataCenterAction ) ; } else { setNote ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > ( noAvailableActions ) ) ; } stopProgress ( ) ; }

Target:
protected void updateOptionsRequiredAddDataCenter ( boolean enableButton ) { if ( enableButton ) { org.ovirt.engine.ui.uicommonweb.UICommand addDataCenterAction = new org.ovirt.engine.ui.uicommonweb.UICommand ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel.ADD_DATA_CENTER , this ) ; addDataCenterAction.setTitle ( addDataCenterTitle ) ; addDataCenterAction.setIsAvailable ( enableButton ) ; getOptionalActions ( ) . add ( addDataCenterAction ) ; } else { setNote ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( noAvailableActions ) ) ; } stopProgress ( ) ; }
Source:
protected void executeQueryCommand ( ) { java.lang.String configuration = getConfigurationFromDb ( org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getParameters ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.common.businessentities.VM result = null ; if ( configuration != null ) { result = getVmFromConfiguration ( configuration ) ; markImagesIllegalIfNotInDb ( result ) ; } else { result = getVmWithoutConfiguration ( ) ; } org.ovirt.engine.core.bll.VmHandler.updateDisksForVm ( result , result.getImages ( ) ) ; org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.lang.String configuration = getConfigurationFromDb ( org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getParameters ( ) . isFiltered ( ) ) ; org.ovirt.engine.core.common.businessentities.VM result = null ; if ( configuration != null ) { result = getVmFromConfiguration ( configuration ) ; markImagesIllegalIfNotInDb ( result ) ; } else { result = getVmWithoutConfiguration ( ) ; } org.ovirt.engine.core.bll.VmHandler.updateDisksForVm ( result , result.getImages ( ) ) ; org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public void appendCustomValueDoesntHandleNullKeys ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , s ) ; }

Target:
public void appendCustomValueDoesntHandleNullKeys ( ) { final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , s ) ; }