auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangable ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangeable ( true ) ; }
Source:
public void testNotRemovingManagementNetwork ( ) { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ; org.mockito.Mockito.when ( networkValidatorMock.notRemovingManagementNetwork ( ) ) . thenReturn ( propagatedResult ) ; org.junit.Assert.assertThat ( "ValidationResult is not correctly propagated" , networkAttachmentValidatorSpy.notRemovingManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ) ; }

Target:
public void testNotRemovingManagementNetwork ( ) { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; org.ovirt.engine.core.bll.ValidationResult propagatedResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK , "a" ) ; org.mockito.Mockito.when ( networkValidatorMock.notRemovingManagementNetwork ( ) ) . thenReturn ( propagatedResult ) ; org.junit.Assert.assertThat ( "ValidationResult is not propagated correctly" , networkAttachmentValidatorSpy.notRemovingManagementNetwork ( ) , org.hamcrest.Matchers.is ( propagatedResult ) ) ; }
Source:
public void GetUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser u = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , un ) ; }

Target:
public void GetUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , un ) ; }
Source:
protected int calcHostScore ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VM vm , boolean countThreadsAsCores ) { int maxScore = ( MaxSchedulerWeight ) - 1 ; return maxScore - ( super . calcHostScore ( vds , vm , countThreadsAsCores ) ) ; }

Target:
protected int calcHostScore ( org.ovirt.engine.core.common.businessentities.VDS vds , org.ovirt.engine.core.common.businessentities.VM vm , boolean countThreadsAsCores ) { if ( ( ( vds.getUsageCpuPercent ( ) ) == null ) || ( ( vds.getUsageCpuPercent ( ) ) > ( highUtilization ) ) ) { return ( MaxSchedulerWeight ) - 1 ; } return ( ( MaxSchedulerWeight ) - 1 ) - ( super . calcHostScore ( vds , vm , countThreadsAsCores ) ) ; }
Source:
public void testExecuteQueryForType ( org.ovirt.engine.core.common.businessentities.StorageType type ) { org.junit.Assume.assumeTrue ( ( type + " is not a concrete type, skipping" ) , type.isConcreteStorageType ( ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getStorageType ( ) ) . thenReturn ( type ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( ( "Wrong 'Wipe After Delete' value returned for Storage Domain type " + type ) , type.isBlockDomain ( ) , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testExecuteQueryForType ( org.ovirt.engine.core.common.businessentities.storage.StorageType type ) { org.junit.Assume.assumeTrue ( ( type + " is not a concrete type, skipping" ) , type.isConcreteStorageType ( ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getStorageType ( ) ) . thenReturn ( type ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( ( "Wrong 'Wipe After Delete' value returned for Storage Domain type " + type ) , type.isBlockDomain ( ) , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public static void removeImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . remove ( diskImage.getImageId ( ) ) ; }

Target:
public static void removeImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . remove ( diskImage.getImageId ( ) ) ; }
Source:
public void executeCommandWhenFailed ( ) { setVolumeId ( volumeWithRemoveBricksTask ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStopFailed ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJobAborted ( org.mockito.Matchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_STOP_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setVolumeId ( volumeWithRemoveBricksTask ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStopFailed ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . endStepJobAborted ( org.mockito.Matchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.never ( ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_STOP_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult protocolIsNotXmlrpc ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NOT_SUPPORTED_PROTOCOL_FOR_CLUSTER_VERSION ) . when ( ( ( VdsProtocol.XML.equals ( host.getProtocol ( ) ) ) && ( ( Version.v3_6.compareTo ( cluster.getCompatibilityVersion ( ) ) ) <= 0 ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult protocolIsNotXmlrpc ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NOT_SUPPORTED_PROTOCOL_FOR_CLUSTER_VERSION ) . when ( ( ( ( org.ovirt.engine.core.common.businessentities.VdsProtocol.XML ) == ( host.getProtocol ( ) ) ) && ( cluster.getCompatibilityVersion ( ) . greaterOrEquals ( Version.v3_6 ) ) ) ) ; }
Source:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.storage.lsm.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }

Target:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.network.NetworkAttachment postPopulate ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model ) { model.getIpAddressAssignments ( ) . getIpAddressAssignments ( ) . get ( 0 ) . setAssignmentMethod ( "dhcp" ) ; return super . postPopulate ( model ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.NetworkAttachment postPopulate ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model ) { model.getIpAddressAssignments ( ) . getIpAddressAssignments ( ) . get ( 0 ) . setAssignmentMethod ( "dhcp" ) ; model.getQos ( ) . setType ( QosType.HOSTNETWORK.name ( ) . toLowerCase ( ) ) ; return super . postPopulate ( model ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { testFilter = new org.ovirt.engine.ui.frontend.server.gwt.GwtCachingFilter ( ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.CACHE_INIT_PARAM ) ) . thenReturn ( ".*\\.cache\\..*" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.NO_CACHE_INIT_PARAM ) ) . thenReturn ( ".*\\.nocache\\..*" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.NO_STORE_INIT_PARAM ) ) . thenReturn ( ".*RPCService.*" ) ; testFilter.init ( mockConfig ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testFilter = new org.ovirt.engine.ui.frontend.server.gwt.GwtCachingFilter ( ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.CACHE_INIT_PARAM ) ) . thenReturn ( ".*\\.cache\\..*|.*\\/theme(-resource)?\\/.*|.*\\.(css|gif|png|favicon|js|ttf|woff|woff2)(\\?.*)?" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.NO_CACHE_INIT_PARAM ) ) . thenReturn ( ".*WebAdmin\\.html|.*\\.nocache\\..*|.*\\/plugin\\/.*" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( GwtCachingFilter.NO_STORE_INIT_PARAM ) ) . thenReturn ( ".*GenericApiGWTService" ) ; testFilter.init ( mockConfig ) ; }
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.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 ( ) ) ; }

Target:
public void testDeleteUnregisteredEntity ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOMAIN_NFS2_1 ) ; org.junit.Assert.assertEquals ( 1 , ovfEntityDataList.size ( ) ) ; org.junit.Assert.assertFalse ( ovfEntityDataList.isEmpty ( ) ) ; dao.removeEntity ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOMAIN_NFS2_1 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList2 = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOMAIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( ovfEntityDataList2.isEmpty ( ) ) ; }
Source:
public void setCustomValuesOverridesExistingValues ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase underTest = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; underTest.appendCustomValue ( key , "test value" , null ) ; doSetCustomValuesTest ( underTest , key ) ; }

Target:
public void setCustomValuesOverridesDoesNotAffectsOtherKeys ( ) { final java.lang.String key1 = "foo" ; final java.lang.String key2 = "bar" ; b.appendCustomValue ( key2 , "test value 2" , null ) ; doSetCustomValuesTest ( b , key1 ) ; org.junit.Assert.assertThat ( b.getCustomValue ( key2 ) , org.hamcrest.Matchers.is ( "test value 2" ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.MacPool createMacPool ( org.ovirt.engine.core.compat.Guid macPool1Id , java.lang.String macPool1Name ) { final org.ovirt.engine.core.common.businessentities.MacPool macPool = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; macPool.setName ( macPool1Name ) ; macPool.setId ( macPool1Id ) ; return macPool ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult callHasUniqueName ( org.ovirt.engine.core.compat.Guid macPool1Id , org.ovirt.engine.core.compat.Guid macPool2Id , java.lang.String macPool1Name , java.lang.String macPool2Name ) { final org.ovirt.engine.core.common.businessentities.MacPool existingMacPool = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; existingMacPool.setId ( macPool1Id ) ; existingMacPool.setName ( macPool1Name ) ; org.mockito.Mockito.when ( macPoolDaoMock.getAll ( ) ) . thenReturn ( java.util.Arrays.asList ( existingMacPool ) ) ; macPool.setId ( macPool2Id ) ; macPool.setName ( macPool2Name ) ; return macPoolValidator.hasUniqueName ( ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct , org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct , org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmJobsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVdsmCallTimestamp ( xmlRpcStruct ) ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm createVdsmVm ( org.ovirt.engine.core.common.businessentities.VmDynamic dbVmDyanmic , java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct , java.lang.Double notifyTime ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVmId ( xmlRpcStruct ) ; org.ovirt.engine.core.common.businessentities.VmDynamic clonedVmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( dbVmDyanmic ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( clonedVmDynamic , xmlRpcStruct , vdsManager.getCopyVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm ( vmId , notifyTime ) . setVmDynamic ( clonedVmDynamic ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm createVdsmVm ( org.ovirt.engine.core.common.businessentities.VmDynamic dbVmDynamic , java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct , java.lang.Double notifyTime ) { org.ovirt.engine.core.common.businessentities.VmDynamic clonedVmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( dbVmDynamic ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( clonedVmDynamic , xmlRpcStruct , vdsManager.getCopyVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm ( notifyTime ) . setVmDynamic ( clonedVmDynamic ) . setDevicesHash ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVmDevicesHash ( xmlRpcStruct ) ) ; }
Source:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
protected boolean isInterfaceSupportedForPlugUnPlug ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ! ( ( DiskInterface.VirtIO.equals ( disk.getDiskInterface ( ) ) ) || ( DiskInterface.VirtIO_SCSI.equals ( disk.getDiskInterface ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO ) ; return false ; } return true ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Disk loadActiveDisk ( org.ovirt.engine.core.compat.Guid diskId ) { return org.ovirt.engine.core.bll.AbstractDiskVmCommand.getDiskDao ( ) . get ( diskId ) ; }
Source:
private java.lang.String getGlusterNetworkAddress ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String glusterNetworkName ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = getInterfaceDao ( ) . getAllInterfacesForVds ( hostId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( glusterNetworkName.equals ( nic.getNetworkName ( ) ) ) { return nic.getAddress ( ) ; } } return null ; }

Target:
private java.lang.String getGlusterNetworkAddress ( org.ovirt.engine.core.compat.Guid hostId , java.lang.String glusterNetworkName ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = getInterfaceDao ( ) . getAllInterfacesForVds ( hostId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( glusterNetworkName.equals ( nic.getNetworkName ( ) ) ) { return nic.getIpv4Address ( ) ; } } return null ; }
Source:
public void initialize ( ) { super . initialize ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand onSaveCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; onSaveCommand.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) ; onSaveCommand.setIsDefault ( true ) ; getCommands ( ) . add ( onSaveCommand ) ; getCommands ( ) . add ( getCancelCommand ( ) ) ; updateClusters ( ) ; }

Target:
public void initialize ( ) { super . initialize ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand onSaveCommand = org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSave" , this ) ; getCommands ( ) . add ( onSaveCommand ) ; getCommands ( ) . add ( getCancelCommand ( ) ) ; updateClusters ( ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getName ( ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_NAME , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getSharedLocks ( ) { return java.util.Collections.singletonMap ( getParameters ( ) . getContainerId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.REMOTE_VM , getVmIsBeingImportedMessage ( ) ) ) ; }
Source:
public void testPositiveCanDoActionWithNoDisks ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testPositiveCanDoActionWithNoDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }
Source:
public void onSearchableModelActivation ( org.ovirt.engine.ui.userportal.section.main.presenter.SearchableModelActivationEvent event ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel currentModel = modelProvider.getModel ( ) ; if ( ( event.getListModel ( ) ) == currentModel ) { currentModel.getSearchCommand ( ) . Execute ( ) ; } else { currentModel.setItems ( null ) ; currentModel.EnsureAsyncSearchStopped ( ) ; } }

Target:
public void onSearchableModelActivation ( org.ovirt.engine.ui.userportal.section.main.presenter.SearchableModelActivationEvent event ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel currentModel = modelProvider.getModel ( ) ; if ( ( event.getListModel ( ) ) == currentModel ) { currentModel.getSearchCommand ( ) . execute ( ) ; } else { currentModel.setItems ( null ) ; currentModel.ensureAsyncSearchStopped ( ) ; } }
Source:
private void loadIconsToDatabase ( ) { final java.util.Map < java.lang.Integer , java.lang.String > osIdToOsNameMap = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : osIdToOsNameMap.entrySet ( ) ) { final org.ovirt.engine.core.common.queries.VmIconIdSizePair iconIdPair = ensureIconsInDatabase ( entry.getValue ( ) ) ; if ( iconIdPair != null ) { osIdToIconIdMap.put ( entry.getKey ( ) , iconIdPair ) ; } } }

Target:
private void loadIconsToDatabase ( ) { final java.util.Map < java.lang.Integer , java.lang.String > osIdToOsNameMap = osRepository.getUniqueOsNames ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : osIdToOsNameMap.entrySet ( ) ) { final org.ovirt.engine.core.common.queries.VmIconIdSizePair iconIdPair = ensureIconsInDatabase ( entry.getValue ( ) ) ; if ( iconIdPair != null ) { osIdToIconIdMap.put ( entry.getKey ( ) , iconIdPair ) ; } } }
Source:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }
Source:
public void copyFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { setId ( brick.getId ( ) ) ; setVolumeId ( brick.getVolumeId ( ) ) ; setServerId ( brick.getServerId ( ) ) ; setServerName ( brick.getServerName ( ) ) ; setBrickDirectory ( brick.getBrickDirectory ( ) ) ; setBrickOrder ( brick.getBrickOrder ( ) ) ; setStatus ( brick.getStatus ( ) ) ; }

Target:
public void copyFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { setId ( brick.getId ( ) ) ; setVolumeId ( brick.getVolumeId ( ) ) ; setServerId ( brick.getServerId ( ) ) ; setServerName ( brick.getServerName ( ) ) ; setBrickDirectory ( brick.getBrickDirectory ( ) ) ; setBrickOrder ( brick.getBrickOrder ( ) ) ; setUnSyncedEntries ( brick.unSyncedEntries ) ; setUnSyncedEntriesTrend ( brick.getUnSyncedEntriesTrend ( ) ) ; setStatus ( brick.getStatus ( ) ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { setSdDiscardSupport ( true , false ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; junit.framework.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { setSdDiscardSupport ( true , false ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.lang.String mode = vdcOptionDao.getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getOptionValue ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( EngineMessage.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.ActionReturnValue notAllowToRunAction ( org.ovirt.engine.core.common.action.ActionType actionType ) { java.lang.String mode = vdcOptionDao.getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getOptionValue ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( EngineMessage.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }
Source:
private void updateMtuChangeability ( ) { getMtu ( ) . setIsChangable ( ( ( getHasMtu ( ) . getEntity ( ) ) && ( ! ( getExport ( ) . getEntity ( ) ) ) ) ) ; }

Target:
protected void onExportChanged ( ) { boolean externalNetwork = getExport ( ) . getEntity ( ) ; getNetworkLabel ( ) . setIsChangable ( ( ! externalNetwork ) ) ; getNeutronPhysicalNetwork ( ) . setIsChangable ( externalNetwork ) ; getQos ( ) . setIsChangable ( ( ! externalNetwork ) ) ; getAddQosCommand ( ) . setIsExecutionAllowed ( ( ! externalNetwork ) ) ; updateMtuSelectorsChangeability ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isCompatibleWithOs ( ) { java.util.List < java.lang.String > networkDevices = getOsRepository ( ) . getNetworkDevices ( osId , version ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > interfaceTypes = new java.util.ArrayList < > ( ) ; for ( java.lang.String networkDevice : networkDevices ) { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.valueOf ( networkDevice ) ) ; } return ! ( interfaceTypes.contains ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.forValue ( nic.getType ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_INTERFACE_TYPE_IS_NOT_SUPPORTED_BY_OS ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isCompatibleWithOs ( ) { java.util.List < java.lang.String > networkDevices = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getNetworkDevices ( osId , version ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > interfaceTypes = new java.util.ArrayList < > ( ) ; for ( java.lang.String networkDevice : networkDevices ) { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.valueOf ( networkDevice ) ) ; } return ! ( interfaceTypes.contains ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.forValue ( nic.getType ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_INTERFACE_TYPE_IS_NOT_SUPPORTED_BY_OS ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL ) ) ) ; } if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { context.put ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.DELETE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.UserIdentifiers.USERNAME , context.get ( ContextKeys.POSITIONAL ) ) ) ; } if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.ad_groups initAdGroup ( org.ovirt.engine.core.common.businessentities.ad_groups adGroup ) { org.ovirt.engine.core.common.businessentities.ad_groups dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDAO ( ) . get ( adGroup.getid ( ) ) ; if ( dbGroup == null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDAO ( ) . save ( adGroup ) ; dbGroup = adGroup ; } return dbGroup ; }

Target:
public static org.ovirt.engine.core.common.businessentities.ad_groups initAdGroup ( org.ovirt.engine.core.common.businessentities.ad_groups adGroup ) { org.ovirt.engine.core.common.businessentities.ad_groups dbGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . get ( adGroup.getid ( ) ) ; if ( dbGroup == null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . save ( adGroup ) ; dbGroup = adGroup ; } return dbGroup ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runInternalMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters ) { return runMultipleActionsImpl ( actionType , parameters , true , false ) ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllCanDoPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllCanDoPass , waitForResult ) ; } }
Source:
public void testUpdateFailed ( ) throws java.lang.Exception { try { update ( true , false , 1 ) ; } catch ( javax.ws.rs.WebApplicationException e ) { assertNotNull ( e.getResponse ( ) ) ; assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testUpdateFailed ( ) throws java.lang.Exception { try { update ( true , false , 1 ) ; } catch ( javax.ws.rs.WebApplicationException e ) { org.junit.Assert.assertNotNull ( e.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ) ; } }

Target:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap other = ( ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id , other.id ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( persistentStorageDomainStatus , other.persistentStorageDomainStatus ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap other = ( ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ) ( obj ) ) ; return ( java.util.Objects.equals ( id , other.id ) ) && ( java.util.Objects.equals ( persistentStorageDomainStatus , other.persistentStorageDomainStatus ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disksToDiskModelList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = new org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ( ) ; diskModel.setDisk ( disk ) ; diskModels.add ( diskModel ) ; } return diskModels ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disksToDiskModelList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { diskModels.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( disk ) ) ; } return diskModels ; }
Source:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void initNetworkFilterDao ( ) { org.mockito.Mockito.when ( networkFilterDao.getNetworkFilterById ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.INVALID_NETWORK_FILTER_ID ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( networkFilterDao.getNetworkFilterById ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.VALID_NETWORK_FILTER_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.network.NetworkFilter ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.VALID_NETWORK_FILTER_ID ) ) ; }

Target:
private void initNetworkFilterDao ( ) { org.mockito.Mockito.when ( networkFilterDao.getNetworkFilterById ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.INVALID_NETWORK_FILTER_ID ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( networkFilterDao.getNetworkFilterById ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.VALID_NETWORK_FILTER_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.network.NetworkFilter ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.VALID_NETWORK_FILTER_ID ) ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkFilterDao.class , networkFilterDao ) ; }
Source:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getMaxVmsInPool ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 1000 ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVmsInPool , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }