auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }

Target:
private void initSpyCommand ( ) { org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }
Source:
public void getBaseDiskByAlias ( ) { org.junit.Assert.assertTrue ( ( ( dao.getDisksByAlias ( "No such disk alias" ) . size ( ) ) == 0 ) ) ; org.junit.Assert.assertTrue ( ( ( dao.getDisksByAlias ( "New Disk Alias Name" ) . size ( ) ) > 1 ) ) ; }

Target:
public void getBaseDiskByAlias ( ) { org.junit.Assert.assertEquals ( 0 , dao.getDisksByAlias ( "No such disk alias" ) . size ( ) ) ; org.junit.Assert.assertTrue ( ( ( dao.getDisksByAlias ( "New Disk Alias Name" ) . size ( ) ) > 1 ) ) ; }
Source:
private void setUpDaoMocks ( ) { snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.doReturn ( snapshotDaoMock ) . when ( getQuery ( ) ) . getSnapshotDao ( ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAllWithConfiguration ( vmId ) ) . thenReturn ( java.util.Collections.singletonList ( snapshot ) ) ; }

Target:
private void setUpDaoMocks ( ) { org.mockito.Mockito.when ( snapshotDaoMock.getAllWithConfiguration ( vmId ) ) . thenReturn ( java.util.Collections.singletonList ( snapshot ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , getParametersForTask ( parentCommand , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) ) , asyncTaskCreationInfo.getStepId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getCommandId ( ) ) ) ; p.setEntityId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getEntityId ( ) ) ; org.ovirt.engine.core.compat.Guid ret = org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( AsyncTaskType.deleteImage , p , false ) ; return ret ; }

Target:
protected org.ovirt.engine.core.compat.Guid ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , getParametersForTask ( parentCommand , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) ) , asyncTaskCreationInfo.getStepId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getCommandId ( ) ) ) ; p.setEntityId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getEntityId ( ) ) ; org.ovirt.engine.core.compat.Guid ret = org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( AsyncTaskType.deleteImage , p ) ; return ret ; }
Source:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
public void setup ( ) { org.mockito.Mockito.when ( fencedVds.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.FenceProxyLocatorTest.HOST_NAME ) ; org.mockito.Mockito.when ( fencedVds.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.FenceProxyLocatorTest.FENCECD_HOST_ID ) ; org.mockito.Mockito.when ( fencedVds.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; org.mockito.Mockito.when ( fencedVds.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; fenceProxyLocator = new org.ovirt.engine.core.bll.FenceProxyLocator ( fencedVds ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( vdsDao ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.setDbFacade ( dbFacade ) ; }

Target:
public void setup ( ) { dbFacade = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) ; org.mockito.Mockito.when ( fencedVds.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.FenceProxyLocatorTest.HOST_NAME ) ; org.mockito.Mockito.when ( fencedVds.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.FenceProxyLocatorTest.FENCECD_HOST_ID ) ; org.mockito.Mockito.when ( fencedVds.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; org.mockito.Mockito.when ( fencedVds.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; fenceProxyLocator = new org.ovirt.engine.core.bll.FenceProxyLocator ( fencedVds ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( vdsDao ) ; }
Source:
public void executeCommand ( ) { cmd.setGlusterVolumeId ( volumeWithRebalanceTask ) ; mockBackend ( true , JobExecutionStatus.ABORTED , false , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( org.mockito.ArgumentMatchers.eq ( JobExecutionStatus.ABORTED ) , org.mockito.ArgumentMatchers.anyMap ( ) , org.mockito.ArgumentMatchers.eq ( false ) ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { cmd.setGlusterVolumeId ( volumeWithRebalanceTask ) ; mockBackend ( true , JobExecutionStatus.ABORTED , false , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( org.mockito.ArgumentMatchers.eq ( JobExecutionStatus.ABORTED ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( false ) ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > setUpLunsFromDeviceList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > luns = setUpLuns ( ) ; for ( int i = 0 ; i < ( luns.size ( ) ) ; i ++ ) { java.util.HashMap < java.lang.String , java.lang.Boolean > pathsDictionary = new java.util.HashMap < java.lang.String , java.lang.Boolean > ( ) ; pathsDictionary.put ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.PHYSICAL_DEVICE_FIELD , true ) ; luns.get ( i ) . setPathsDictionary ( pathsDictionary ) ; } return luns ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > setUpLunsFromDeviceList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > luns = setUpLuns ( false ) ; for ( int i = 0 ; i < ( luns.size ( ) ) ; i ++ ) { java.util.HashMap < java.lang.String , java.lang.Boolean > pathsDictionary = new java.util.HashMap < java.lang.String , java.lang.Boolean > ( ) ; pathsDictionary.put ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.PHYSICAL_DEVICE_FIELD , true ) ; luns.get ( i ) . setPathsDictionary ( pathsDictionary ) ; } return luns ; }
Source:
public void testGetAllWithName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllWithName ( existingVds.getVdsName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( existingVds.getVdsName ( ) , vds.getVdsName ( ) ) ; } }

Target:
public void testGetAllWithName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllWithName ( existingVds.getName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( existingVds.getName ( ) , vds.getName ( ) ) ; } }
Source:
public void setPmProxyPreferences ( java.lang.String value ) { java.lang.String [ ] array = value.split ( "," ) ; java.util.List < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( ) ; for ( java.lang.String item : array ) { list.add ( item ) ; } getPmProxyPreferencesList ( ) . setItems ( list ) ; }

Target:
public void setPmProxyPreferences ( java.lang.String value ) { java.lang.String [ ] array = value.split ( "," ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > list = new java.util.ArrayList < > ( ) ; for ( java.lang.String item : array ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > model = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; model.setEntity ( item ) ; list.add ( model ) ; } getPmProxyPreferencesList ( ) . setItems ( list ) ; }
Source:
private org.ovirt.engine.api.model.API addSystemVersion ( org.ovirt.engine.api.model.API api ) { java.lang.String productVersion = getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.ProductRPMVersion ) ; api.setProductInfo ( new org.ovirt.engine.api.model.ProductInfo ( ) ) ; api.getProductInfo ( ) . setName ( "oVirt Engine" ) ; api.getProductInfo ( ) . setVendor ( "ovirt.org" ) ; api.getProductInfo ( ) . setFullVersion ( productVersion ) ; api.getProductInfo ( ) . setVersion ( org.ovirt.engine.api.restapi.util.VersionHelper.parseVersion ( getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.VdcVersion ) ) ) ; return api ; }

Target:
private org.ovirt.engine.api.model.API addSystemVersion ( org.ovirt.engine.api.model.API api ) { api.setProductInfo ( new org.ovirt.engine.api.model.ProductInfo ( ) ) ; api.getProductInfo ( ) . setName ( "oVirt Engine" ) ; api.getProductInfo ( ) . setVendor ( "ovirt.org" ) ; api.getProductInfo ( ) . setVersion ( org.ovirt.engine.api.restapi.util.VersionHelper.parseVersion ( getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.VdcVersion ) ) ) ; return api ; }
Source:
private void mockStorageDomainValidator ( ) { org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( cmd ) . getStorageDomainValidator ( ) ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteLegalForExistingStorageDomain ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; }

Target:
private void mockStorageDomainValidator ( ) { org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( cmd ) . getStorageDomainValidator ( ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Network nwk ) { setEnumTitle ( nwk.getCluster ( ) . getstatus ( ) ) ; switch ( nwk.getCluster ( ) . getstatus ( ) ) { case Operational : return getApplicationResources ( ) . upImage ( ) ; case NonOperational : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Network nwk ) { return getValue ( nwk.getCluster ( ) ) ; }
Source:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( FixturesTool.USER_EXISTING_ID , ActionGroup.CONFIGURE_VM_STORAGE , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }

Target:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( FixturesTool.USER_EXISTING_ID , ActionGroup.CONFIGURE_VM_STORAGE , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }
Source:
public void commandFailsSlaveVolumeNotUp ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( volume ) . when ( command ) . getSlaveVolume ( ) ; org.mockito.Mockito.doReturn ( GlusterStatus.DOWN ) . when ( volume ) . getStatus ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; }

Target:
public void commandFailsSlaveVolumeNotUp ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( volume ) . when ( command ) . getSlaveVolume ( ) ; org.mockito.Mockito.doReturn ( GlusterStatus.DOWN ) . when ( volume ) . getStatus ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( cinderDisks , vmSnapshotId , diskInfoDestinationMap ) ; createParams.setParentHasTasks ( ( ! ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) ) ) ; return withRootCommandInfo ( createParams ) ; }

Target:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid vmSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( cinderDisks , vmSnapshotId , diskInfoDestinationMap ) ; return withRootCommandInfo ( createParams ) ; }
Source:
public static void removeDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { try { org.ovirt.engine.core.bll.ImagesHandler.removeDiskFromVm ( diskImage.getvm_guid ( ) , diskImage.getId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }

Target:
public static void removeDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }
Source:
public void shouldCheckIfClusterCanBeUpgraded ( ) { createCommandWithDefaultCluster ( ) ; cpuExists ( ) ; architectureIsUpdatable ( ) ; cmd.getCluster ( ) . setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; initAndAssertValidation ( true ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isUpgradePossible ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isUpgradeDone ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void shouldCheckIfClusterCanBeUpgraded ( ) { createCommandWithDefaultCluster ( ) ; cpuExists ( ) ; architectureIsUpdatable ( ) ; cmd.getCluster ( ) . setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; initAndAssertValidation ( true ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isUpgradePossible ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isUpgradeDone ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void editMacPool ( ) { org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel model = new org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel ( this , org.ovirt.engine.core.common.action.VdcActionType.UpdateMacPool ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . editSharedMacPoolTitle ( ) ) ; model.setHashName ( "edit_shared_mac_pool" ) ; model.setHelpTag ( HelpTag.edit_shared_mac_pool ) ; setWindow ( model ) ; model.setEntity ( ( ( org.ovirt.engine.core.common.businessentities.MacPool ) ( getSelectedItem ( ) ) ) ) ; }

Target:
private void editMacPool ( ) { org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel model = new org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel ( this , org.ovirt.engine.core.common.action.VdcActionType.UpdateMacPool ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . editSharedMacPoolTitle ( ) ) ; model.setHashName ( "edit_shared_mac_pool" ) ; model.setHelpTag ( HelpTag.edit_shared_mac_pool ) ; model.setEntity ( ( ( org.ovirt.engine.core.common.businessentities.MacPool ) ( getSelectedItem ( ) ) ) ) ; setWindow ( model ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StoragePool createStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setName ( "DefaultStoragePool" ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; pool.setIsLocal ( false ) ; pool.setCompatibilityVersion ( compatibilityVersion ) ; return pool ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StoragePool createStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setName ( "DefaultStoragePool" ) ; pool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; pool.setIsLocal ( false ) ; return pool ; }
Source:
private void mockFenceVdsResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result1 , org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result2 ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal1 = createVdsReturnValue ( result1 ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal2 = ( result2 == null ) ? null : createVdsReturnValue ( result2 ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.FenceVds ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters.class ) ) ) . thenReturn ( retVal1 ) . thenReturn ( retVal2 ) ; }

Target:
private void mockFenceVdsResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result1 , org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result2 ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal1 = createVdsReturnValue ( result1 ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal2 = ( result2 == null ) ? null : createVdsReturnValue ( result2 ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.FenceVds ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( retVal1 ) . thenReturn ( retVal2 ) ; }
Source:
private void editMacPool ( ) { org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel model = new org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel ( this , org.ovirt.engine.core.common.action.VdcActionType.UpdateMacPool ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . editSharedMacPoolTitle ( ) ) ; model.setHashName ( "edit_shared_mac_pool" ) ; model.setHelpTag ( HelpTag.edit_shared_mac_pool ) ; model.setEntity ( ( ( org.ovirt.engine.core.common.businessentities.MacPool ) ( getSelectedItem ( ) ) ) ) ; setWindow ( model ) ; }

Target:
private void editMacPool ( ) { org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel model = new org.ovirt.engine.ui.uicommonweb.models.macpool.SharedMacPoolModel ( this , org.ovirt.engine.core.common.action.VdcActionType.UpdateMacPool ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . editSharedMacPoolTitle ( ) ) ; model.setHashName ( "edit_shared_mac_pool" ) ; model.setHelpTag ( HelpTag.edit_shared_mac_pool ) ; model.setEntity ( getSelectedItem ( ) ) ; setWindow ( model ) ; }
Source:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage ) ; } } }

Target:
public void removeAllIllegalDisks ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ) { if ( ( diskImage.getimageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.ILLEGAL ) ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , vmId ) ; } } }
Source:
public void encodeDecodeWithNonAsciiDiskAliasAndDescription ( ) throws java.lang.Exception { disk.setDiskAlias ( "áéíñáéíñ" ) ; disk.setDiskDescription ( "áéíñ" ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñáéíñ" ) ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskDescriptionJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñ" ) ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateEncodingJsonEntry ( 3 ) ) ; org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.assertDiskDescriptionDecoding ( disk ) ; }

Target:
public void encodeDecodeWithNonAsciiDiskAliasAndDescription ( ) throws java.lang.Exception { disk.setDiskAlias ( "áéíñáéíñ" ) ; disk.setDiskDescription ( "áéíñ" ) ; assertDiskDescriptionMap ( disk , generateDiskAliasJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñáéíñ" ) ) , generateDiskDescriptionJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñ" ) ) , generateEncodingJsonEntry ( 3 ) ) ; assertDiskDescriptionDecoding ( disk ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getParameters ( ) . getDescription ( ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , getParameters ( ) . getDescription ( ) ) ; } return jobProperties ; }
Source:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.IAutoCompleter comp = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; org.junit.Assert.assertTrue ( "luke" , comps.contains ( "luke" ) ) ; org.junit.Assert.assertTrue ( "leia" , comps.contains ( "leia" ) ) ; }

Target:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; org.junit.Assert.assertTrue ( "luke" , comps.contains ( "luke" ) ) ; org.junit.Assert.assertTrue ( "leia" , comps.contains ( "leia" ) ) ; }
Source:
private boolean hostCompliesWithClusterEmulationMode ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { java.lang.String clusterEmulatedMachine = vdsGroup.getEmulatedMachine ( ) ; java.lang.String [ ] hostSupportedEmulatedMachines = ( ( vds.getSupportedEmulatedMachines ( ) ) != null ) ? vds.getSupportedEmulatedMachines ( ) . split ( "," ) : new java.lang.String [ ] { "" } ; if ( ( clusterEmulatedMachine == null ) || ( clusterEmulatedMachine.isEmpty ( ) ) ) { return hostEmulationModeMatchesTheConfigValues ( vds , hostSupportedEmulatedMachines ) ; } else { return java.util.Arrays.asList ( hostSupportedEmulatedMachines ) . contains ( clusterEmulatedMachine ) ; } }

Target:
private boolean hostCompliesWithClusterEmulationMode ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { java.lang.String clusterEmulatedMachine = vdsGroup.getEmulatedMachine ( ) ; if ( ( clusterEmulatedMachine == null ) || ( clusterEmulatedMachine.isEmpty ( ) ) ) { return hostEmulationModeMatchesTheConfigValues ( vds ) ; } else { return ( vds.getSupportedEmulatedMachines ( ) ) != null ? java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) . contains ( clusterEmulatedMachine ) : false ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.Network FindNetworkByName ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > items , java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.Network n : items ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( n.getname ( ) , name ) ) { return n ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.Network FindNetworkByName ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > items , java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.network.Network n : items ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( n.getname ( ) , name ) ) { return n ; } } return null ; }
Source:
public javax.ws.rs.core.Response resetOption ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.api.model.Option option = action.getOption ( ) ; validateParameters ( option , "name" ) ; return resetOption ( action , option.getName ( ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) ; }

Target:
public javax.ws.rs.core.Response resetOption ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.api.model.Option option = action.getOption ( ) ; validateParameters ( option , "name" ) ; return resetOption ( action , option.getName ( ) , option.getValue ( ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) ; }
Source:
public void onUserLoginChange ( org.ovirt.engine.ui.common.auth.UserLoginChangeEvent event ) { if ( user.isLoggedIn ( ) ) { manager.invokePluginsNowOrLater ( "UserLogin" , org.ovirt.engine.ui.webadmin.plugin.jsni.JsArrayHelper.createStringArray ( user.getUserName ( ) , user.getUserId ( ) . toString ( ) ) ) ; } else { manager.invokePluginsNowOrLater ( "UserLogout" , null ) ; } }

Target:
public void onUserLoginChange ( org.ovirt.engine.ui.common.auth.UserLoginChangeEvent event ) { if ( user.isLoggedIn ( ) ) { manager.invokePluginsNowOrLater ( "UserLogin" , org.ovirt.engine.ui.webadmin.plugin.jsni.JsArrayHelper.createStringArray ( user.getUserName ( ) , user.getUserId ( ) ) ) ; } else { manager.invokePluginsNowOrLater ( "UserLogout" , null ) ; } }
Source:
protected void executeCommand ( ) { AddCustomValue ( "InterfaceType" , org.ovirt.engine.core.common.businessentities.VmInterfaceType.forValue ( org.ovirt.engine.core.bll.network.template.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) . getType ( ) ) . getDescription ( ) . toString ( ) ) ; org.ovirt.engine.core.bll.network.template.UpdateVmTemplateInterfaceCommand.getVmNetworkInterfaceDao ( ) . update ( org.ovirt.engine.core.bll.network.template.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) ) ; org.ovirt.engine.core.bll.network.template.UpdateVmTemplateInterfaceCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.template.UpdateVmTemplateInterfaceCommand.getVmNetworkInterfaceDao ( ) . update ( org.ovirt.engine.core.bll.network.template.UpdateVmTemplateInterfaceCommand.getParameters ( ) . getInterface ( ) ) ; org.ovirt.engine.core.bll.network.template.UpdateVmTemplateInterfaceCommand.setSucceeded ( true ) ; }
Source:
public < T > T get ( org.ovirt.engine.api.extensions.ExtKey key , T defaultValue ) { if ( ! ( key.getType ( ) . isAssignableFrom ( defaultValue.getClass ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Cannnot assign default value of '%s' into type '%s'" , defaultValue.getClass ( ) , key ) ) ; } T value = get ( key ) ; if ( value == null ) { value = defaultValue ; } return value ; }

Target:
public < T > T get ( org.ovirt.engine.api.extensions.ExtKey key , T defaultValue ) { if ( ( defaultValue != null ) && ( ! ( key.getType ( ) . isAssignableFrom ( defaultValue.getClass ( ) ) ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Cannnot assign default value of '%s' into type '%s'" , defaultValue.getClass ( ) , key ) ) ; } T value = get ( key ) ; if ( value == null ) { value = defaultValue ; } return value ; }
Source:
public void testValidName ( ) { prepareVmToPassCanDoAction ( ) ; boolean c = command.canDoAction ( ) ; java.lang.System.out.println ( command.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; java.lang.System.out.println ( command.getParameters ( ) . getVm ( ) . getOs ( ) ) ; junit.framework.Assert.assertTrue ( "canDoAction should have passed." , c ) ; }

Target:
public void testValidName ( ) { prepareVmToPassCanDoAction ( ) ; boolean c = command.canDoAction ( ) ; junit.framework.Assert.assertTrue ( "canDoAction should have passed." , c ) ; }
Source:
public < T > T get ( org.ovirt.engine.api.extensions.ExtKey key , T defaultValue ) { if ( ( defaultValue != null ) && ( ! ( key.getType ( ) . isAssignableFrom ( defaultValue.getClass ( ) ) ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Cannnot assign default value of '%s' into type '%s'" , defaultValue.getClass ( ) , key ) ) ; } T value = get ( key ) ; if ( value == null ) { value = defaultValue ; } return value ; }

Target:
public < T > T get ( org.ovirt.engine.api.extensions.ExtKey key , java.lang.Object defaultValue ) { if ( ( defaultValue != null ) && ( ! ( key.getType ( ) . isAssignableFrom ( defaultValue.getClass ( ) ) ) ) ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Cannnot assign default value of '%s' into type '%s'" , defaultValue.getClass ( ) , key ) ) ; } java.lang.Object value = get ( key ) ; if ( value == null ) { value = defaultValue ; } return ( ( T ) ( value ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean isValid = super . canDoAction ( ) ; if ( isValid && ( wasNumOfVfsChanged ( ) ) ) { isValid = ( validate ( getVfsConfigValidator ( ) . allVfsAreFree ( networkDeviceHelper ) ) ) && ( validate ( getVfsConfigValidator ( ) . numOfVfsInValidRange ( getNumOfVfs ( ) ) ) ) ; } return isValid ; }

Target:
protected boolean validate ( ) { boolean isValid = super . validate ( ) ; if ( isValid && ( wasNumOfVfsChanged ( ) ) ) { isValid = ( validate ( getVfsConfigValidator ( ) . allVfsAreFree ( networkDeviceHelper ) ) ) && ( validate ( getVfsConfigValidator ( ) . numOfVfsInValidRange ( getNumOfVfs ( ) ) ) ) ; } return isValid ; }
Source:
public org.ovirt.engine.api.model.Capabilities list ( ) { org.ovirt.engine.api.model.Capabilities caps = new org.ovirt.engine.api.model.Capabilities ( ) ; for ( org.ovirt.engine.api.model.Version v : getSupportedClusterLevels ( ) ) { caps.getVersions ( ) . add ( generateVersionCaps ( v ) ) ; } caps.setPermits ( getPermits ( ) ) ; caps.setSchedulingPolicies ( getSchedulingPolicies ( ) ) ; return caps ; }

Target:
public org.ovirt.engine.api.model.Capabilities list ( ) { org.ovirt.engine.api.model.Capabilities caps = new org.ovirt.engine.api.model.Capabilities ( ) ; for ( org.ovirt.engine.api.model.Version v : getSupportedClusterLevels ( ) ) { caps.getVersions ( ) . add ( generateVersionCaps ( v ) ) ; } caps.setSchedulingPolicies ( getSchedulingPolicies ( ) ) ; return caps ; }
Source:
private void initVm ( org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , org.ovirt.engine.core.compat.NGuid runOnVds , org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( vmStatus ) ; vm.setRunOnVds ( runOnVds ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( diskImageId ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; }

Target:
private void initVm ( org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , org.ovirt.engine.core.compat.Guid runOnVds , org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( vmStatus ) ; vm.setRunOnVds ( runOnVds ) ; org.mockito.Mockito.when ( vmDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vm ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( diskImageId ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; }
Source:
protected boolean checkDomainCanBeAttached ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { return ( ( ( ( checkStorageDomainType ( storageDomain ) ) && ( isStorageDomainFormatCorrectForPool ( storageDomain , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ) ) && ( checkStorageDomainSharedStatusNotLocked ( storageDomain ) ) ) && ( ( ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) || ( isStorageDomainNotInPool ( storageDomain ) ) ) ) && ( isStorageDomainTypeCorrect ( storageDomain ) ) ; }

Target:
protected boolean checkDomainCanBeAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { return ( ( ( ( checkStorageDomainType ( storageDomain ) ) && ( isStorageDomainFormatCorrectForPool ( storageDomain , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ) ) && ( checkStorageDomainSharedStatusNotLocked ( storageDomain ) ) ) && ( ( ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) || ( isStorageDomainNotInPool ( storageDomain ) ) ) ) && ( isStorageDomainTypeCorrect ( storageDomain ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , false , "" ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , false , "" , null ) ; }
Source:
private boolean canRemoveNics ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; if ( VMStatus.Down.equals ( vm.getStatus ( ) ) ) { return true ; } java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( nic.isPlugged ( ) ) { return false ; } } return true ; }

Target:
private boolean canRemoveNics ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; if ( VMStatus.Down.equals ( vm.getStatus ( ) ) ) { return true ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( getSelectedItems ( ) ) != null ) ? getSelectedItems ( ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( nic.isPlugged ( ) ) { return false ; } } return true ; }
Source:
public void testIncompleteExport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { control.replay ( ) ; resource.export ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "export" , "storageDomain.id|name" ) ; } }

Target:
public void testIncompleteExport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.export ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "export" , "storageDomain.id|name" ) ; } }
Source:
public static void RunMultipleAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final boolean isRunOnlyIfAllCanDoPass , final org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback callback , final java.lang.Object state ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( actionType , parameters , isRunOnlyIfAllCanDoPass , callback , state ) ; }

Target:
public void runMultipleAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters ) { runMultipleAction ( actionType , parameters , null , null ) ; }
Source:
protected boolean CheckStoragePoolStatusNotEqual ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.common.errors.VdcBllMessages onFailMessage ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getstatus ( ) ) != status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( onFailMessage.name ( ) ) ) ) ) { addCanDoActionMessage ( onFailMessage ) ; } } return returnValue ; }

Target:
protected boolean CheckStoragePoolStatusNotEqual ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.common.errors.VdcBllMessages onFailMessage ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getStatus ( ) ) != status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( onFailMessage.name ( ) ) ) ) ) { addCanDoActionMessage ( onFailMessage ) ; } } return returnValue ; }
Source:
protected boolean canDoAction ( ) { return ( ( ( ( validate ( networkExists ( getRemovedNetwork ( ) ) ) ) && ( validate ( notManagementNetwork ( ) ) ) ) && ( validate ( networkNotUsedByVms ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByTemplates ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByHosts ( getRemovedNetwork ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( ( ( validate ( networkExists ( getRemovedNetwork ( ) ) ) ) && ( validate ( notManagementNetwork ( ) ) ) ) && ( validate ( networkNotUsedByVms ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByTemplates ( getRemovedNetwork ( ) ) ) ) ; }
Source:
private boolean isEveyoneUserPortalBasedVmPermission ( org.ovirt.engine.core.common.businessentities.permissions permission ) { return ( permission.getad_element_id ( ) . getValue ( ) . equals ( ApplicationGuids.everyone.asGuid ( ) ) ) && ( permission.getrole_id ( ) . getValue ( ) . equals ( ApplicationGuids.userTemplateBasedVM.asGuid ( ) ) ) ; }

Target:
private boolean isEveyoneUserPortalBasedVmPermission ( org.ovirt.engine.core.common.businessentities.permissions permission ) { return ( permission.getad_element_id ( ) . equals ( ApplicationGuids.everyone.asGuid ( ) ) ) && ( permission.getrole_id ( ) . equals ( ApplicationGuids.userTemplateBasedVM.asGuid ( ) ) ) ; }