auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNetworkNotAttachedToHost ( ) throws java.lang.Exception { org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) , null ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkNotAttachedToHostWhenAttached ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( org.mockito.Matchers.eq ( networkId ) ) ) . thenReturn ( java.util.Collections.singletonList ( host ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( networkId ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_ALREADY_ATTACHED_TO_HOST ) ) ; }
Source:
public static void GetVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters params = new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
private void portMirroringTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.lang.String networkName , boolean portMirroring ) { org.mockito.Mockito.when ( nic.getNetworkName ( ) ) . thenReturn ( networkName ) ; org.mockito.Mockito.when ( nic.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.junit.Assert.assertThat ( validator.networkProvidedForPortMirroring ( ) , matcher ) ; }

Target:
private void vnicProfileTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , boolean networkLinkingSupported , org.ovirt.engine.core.compat.Guid vnicProfileId ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.getVnicProfileId ( ) ) . thenReturn ( vnicProfileId ) ; org.junit.Assert.assertThat ( validator.emptyNetworkValid ( ) , matcher ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testFindDefaultManagementNetworkNonDefault ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockNetworkDao.getManagementNetworks ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockNetwork ) ; }

Target:
public void testFindDefaultManagementNetworkNonDefault ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Arrays.asList ( mockNetwork , mockNetwork ) ) ; org.mockito.Mockito.when ( mockNetworkDao.getManagementNetworks ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockNetwork ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; getProviders ( ) . setIsChangable ( true ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { externalHostGroups_SelectedItemChanged ( ) ; }
Source:
public void testNetworkIpAddressWasSameAsHostnameAndChangedWhenIfaceDoesNotExist ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.STATIC_IP , null , null ) ; attachment.setNicName ( "nicName" ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.networkIpAddressWasSameAsHostnameAndChanged ( nics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkIpAddressWasSameAsHostnameAndChangedWhenIfaceDoesNotExist ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( Ipv4BootProtocol.STATIC_IP , null , null ) ; attachment.setNicName ( "nicName" ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.networkIpAddressWasSameAsHostnameAndChanged ( nics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void lockVmSnapshotsWithWait ( org.ovirt.engine.core.common.businessentities.VM vm ) { snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , LockMessagesMatchUtil.VM_SNAPSHOTS ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; org.ovirt.engine.core.bll.RemoveImageCommand.getLockManager ( ) . acquireLockWait ( snapshotsEngineLock ) ; }

Target:
private void lockVmSnapshotsWithWait ( org.ovirt.engine.core.common.businessentities.VM vm ) { snapshotsEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > snapshotsExlusiveLockMap = java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_SNAPSHOTS , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; snapshotsEngineLock.setExclusiveLocks ( snapshotsExlusiveLockMap ) ; org.ovirt.engine.core.bll.RemoveImageCommand.getLockManager ( ) . acquireLockWait ( snapshotsEngineLock ) ; }
Source:
public static java.lang.String mergeDcAndCluster ( java.lang.String dataCenter , java.lang.String cluster ) { if ( org.ovirt.engine.ui.uicompat.external.StringUtils.isEmpty ( cluster ) ) { return dataCenter ; } return ( dataCenter + "/" ) + cluster ; }

Target:
public static java.lang.String mergeDcAndCluster ( java.lang.String dataCenter , java.lang.String cluster , boolean toEncode ) { if ( org.ovirt.engine.ui.uicompat.external.StringUtils.isEmpty ( cluster ) ) { return toEncode ? com.google.gwt.http.client.URL.encodePathSegment ( dataCenter ) : dataCenter ; } return toEncode ? ( ( com.google.gwt.http.client.URL.encodePathSegment ( dataCenter ) ) + "/" ) + ( com.google.gwt.http.client.URL.encodePathSegment ( cluster ) ) : ( dataCenter + "/" ) + cluster ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; return performAction ( VdcActionType.DetachNetworkToCluster , new org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter ( getCluster ( ) , getNetwork ( ) ) ) ; }

Target:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { org.ovirt.engine.api.model.Network network = map ( incoming , map ( get ( ) ) ) ; network.getCluster ( ) . setNetworkId ( network.getId ( ) ) ; network.getCluster ( ) . setClusterId ( cluster.getCluster ( ) . getId ( ) ) ; performAction ( VdcActionType.UpdateNetworkOnCluster , new org.ovirt.engine.core.common.action.NetworkClusterParameters ( network.getCluster ( ) ) ) ; return get ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getDataCenter ( ) ) ) ) { DataCenter_SelectedItemChanged ( ) ; } else if ( ( ev.equals ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getCluster ( ) ) ) ) { Cluster_SelectedItemChanged ( ) ; } else if ( sender == ( getConsoleAddressEnabled ( ) ) ) { consoleAddressChanged ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getDataCenter ( ) ) ) ) { DataCenter_SelectedItemChanged ( ) ; } else if ( ( ev.equals ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getCluster ( ) ) ) ) { Cluster_SelectedItemChanged ( ) ; } else if ( sender == ( getConsoleAddressEnabled ( ) ) ) { consoleAddressChanged ( ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.network.IpV6Address apply ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.IpV6Address ipv6Address = new org.ovirt.engine.core.common.businessentities.network.IpV6Address ( ) ; if ( ( nic.getIpv6BootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.STATIC_IP ) ) { ipv6Address.setAddress ( nic.getIpv6Address ( ) ) ; ipv6Address.setPrefix ( nic.getIpv6Prefix ( ) ) ; ipv6Address.setGateway ( nic.getIpv6Gateway ( ) ) ; } ipv6Address.setBootProtocol ( nic.getIpv6BootProtocol ( ) ) ; return ipv6Address ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.IpV6Address apply ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.IpV6Address ipv6Address = new org.ovirt.engine.core.common.businessentities.network.IpV6Address ( ) ; if ( ( nic.getIpv6BootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol.STATIC_IP ) ) { ipv6Address.setAddress ( nic.getIpv6Address ( ) ) ; ipv6Address.setPrefix ( nic.getIpv6Prefix ( ) ) ; ipv6Address.setGateway ( nic.getIpv6Gateway ( ) ) ; } ipv6Address.setBootProtocol ( nic.getIpv6BootProtocol ( ) ) ; return ipv6Address ; }
Source:
public void testConnectionWithInvalidMountOptionsFails ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) . when ( getCommand ( ) ) . validateMountOptions ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( getCommand ( ) , VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ; }

Target:
public void testConnectionWithInvalidMountOptionsFails ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ) . when ( getCommand ( ) ) . validateMountOptions ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( getCommand ( ) , EngineMessage.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY ) ; }
Source:
protected void alertIfPowerManagementNotConfigured ( org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic ) { if ( ( ( org.ovirt.engine.core.bll.VdsCommand.getVdsGroup ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.VdsCommand.getVdsGroup ( ) . supportsVirtService ( ) ) ) ) { return ; } if ( ! ( vdsStatic.isPmEnabled ( ) ) ) { Alert ( AuditLogType.VDS_ALERT_FENCE_IS_NOT_CONFIGURED ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.RemoveVdsAlert ( vdsStatic.getId ( ) , AuditLogType.VDS_ALERT_FENCE_TEST_FAILED ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.RemoveVdsAlert ( vdsStatic.getId ( ) , AuditLogType.VDS_ALERT_FENCE_IS_NOT_CONFIGURED ) ; } }

Target:
protected void alertIfPowerManagementNotConfigured ( org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic ) { if ( ( ( org.ovirt.engine.core.bll.VdsCommand.getVdsGroup ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.VdsCommand.getVdsGroup ( ) . supportsVirtService ( ) ) ) ) { return ; } if ( ! ( vdsStatic.isPmEnabled ( ) ) ) { Alert ( AuditLogType.VDS_ALERT_FENCE_IS_NOT_CONFIGURED ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVdsAlert ( vdsStatic.getId ( ) , AuditLogType.VDS_ALERT_FENCE_TEST_FAILED ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVdsAlert ( vdsStatic.getId ( ) , AuditLogType.VDS_ALERT_FENCE_IS_NOT_CONFIGURED ) ; } }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > getDiskImageListFromDiskMap ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Disk > diskMap ) { return new java.util.ArrayList ( org.ovirt.engine.core.utils.linq.LinqUtils.foreach ( diskMap.values ( ) , new org.ovirt.engine.core.utils.linq.Function < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.DiskImage > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.DiskImage eval ( org.ovirt.engine.core.common.businessentities.Disk disk ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; } } ) ) ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > getDiskImageListFromDiskMap ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.Disk > diskMap ) { return new java.util.ArrayList ( org.ovirt.engine.core.utils.linq.LinqUtils.transformToList ( diskMap.values ( ) , new org.ovirt.engine.core.utils.linq.Function < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.DiskImage > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.DiskImage eval ( org.ovirt.engine.core.common.businessentities.Disk disk ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; } } ) ) ; }
Source:
protected void EntityChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { org.ovirt.engine.core.compat.IProvidePropertyChangedEvent notifier = ( ( org.ovirt.engine.core.compat.IProvidePropertyChangedEvent ) ( ( oldValue instanceof org.ovirt.engine.core.compat.IProvidePropertyChangedEvent ) ? oldValue : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . removeListener ( this ) ; } notifier = ( ( org.ovirt.engine.core.compat.IProvidePropertyChangedEvent ) ( ( newValue instanceof org.ovirt.engine.core.compat.IProvidePropertyChangedEvent ) ? newValue : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . addListener ( this ) ; } }

Target:
protected void EntityChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( oldValue instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? oldValue : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . removeListener ( this ) ; } notifier = ( ( org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ( ( newValue instanceof org.ovirt.engine.ui.uicompat.IProvidePropertyChangedEvent ) ? newValue : null ) ) ; if ( notifier != null ) { notifier.getPropertyChangedEvent ( ) . addListener ( this ) ; } }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.Quota quota ) { getCallsHandler ( ) . executeModification ( "UpdateQuotaMetaData" , createQuotaMetaDataParameterMapper ( quota ) ) ; getCallsHandler ( ) . executeModification ( "DeleteQuotaLimitationByQuotaGuid" , createQuotaIdParameterMapper ( quota.getId ( ) ) ) ; getCallsHandler ( ) . executeModification ( "InsertQuotaLimitation" , getFullQuotaParameterMap ( quota ) ) ; saveStorageSpecificQuotas ( quota ) ; saveVdsGroupSpecificQuotas ( quota ) ; }

Target:
public void update ( org.ovirt.engine.core.common.businessentities.Quota quota ) { getCallsHandler ( ) . executeModification ( "UpdateQuotaMetaData" , createQuotaMetaDataParameterMapper ( quota ) ) ; getCallsHandler ( ) . executeModification ( "DeleteQuotaLimitationByQuotaGuid" , createQuotaIdParameterMapper ( quota.getId ( ) ) ) ; getCallsHandler ( ) . executeModification ( "InsertQuotaLimitation" , getFullQuotaParameterMap ( quota ) ) ; saveStorageSpecificQuotas ( quota ) ; saveClusterSpecificQuotas ( quota ) ; }
Source:
private static void checkForMissingDefault ( java.lang.reflect.Method method , java.util.List < java.lang.String > errors ) { if ( ( method.getAnnotation ( com.google.gwt.i18n.client.Messages.DefaultMessage.class ) ) == null ) { if ( ! ( org.ovirt.engine.ui.uicompat.GwtMessagesValidator.PropertiesFileInfo.properties.contains ( method.getName ( ) ) ) ) { errors.add ( ( ( ( ( "Key: " + ( method.getName ( ) ) ) + " not found in properties file: " ) + ( org.ovirt.engine.ui.uicompat.GwtMessagesValidator.PropertiesFileInfo.fileName ) ) + " and no default is defined" ) ) ; } } }

Target:
private static void checkForMissingDefault ( java.lang.reflect.Method method , java.util.Properties defaultProperties , java.util.Properties localeProperties , java.lang.String localeFileName , java.util.List < java.lang.String > errors ) { java.lang.String key = method.getName ( ) ; if ( ! ( defaultProperties.containsKey ( key ) ) ) { if ( ! ( localeProperties.containsKey ( key ) ) ) { errors.add ( ( ( ( ( "Key: " + ( method.getName ( ) ) ) + " not found in properties file: " ) + localeFileName ) + " and no default is defined" ) ) ; } } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDbFacade ( ) . getDiskDao ( ) . get ( getParameters ( ) . getObjectId ( ) ) ; if ( disk == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } if ( ( disk.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION ) ; return false ; } this . disk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ; return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = getDbFacade ( ) . getDiskDao ( ) . get ( getParameters ( ) . getObjectId ( ) ) ; if ( disk == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } if ( ( disk.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION ) ; return false ; } this . disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; return super . canDoAction ( ) ; }
Source:
protected javax.ws.rs.core.Response performCreation ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { return performCreation ( task , taskParams , entityResolver , expectBlocking ( ) , suggestedParentType ) ; }

Target:
protected final < T > javax.ws.rs.core.Response performCreate ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , boolean block , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.core.common.action.VdcReturnValueBase createResult = doCreateEntity ( task , taskParams ) ; return fetchCreatedEntity ( entityResolver , block , suggestedParentType , createResult ) ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.Nic > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }

Target:
protected void setUpQueryExpectations ( java.lang.String query ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; }
Source:
public void postOnCreateVolume ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; org.ovirt.engine.core.compat.Guid volumeId = ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) ; if ( ( ( java.lang.Boolean ) ( model.getOptimizeForVirtStore ( ) . getEntity ( ) ) ) ) { optimizeVolumesForVirtStore ( java.util.Arrays.asList ( volumeId ) ) ; } } }

Target:
public void postOnCreateVolume ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; if ( model.getOptimizeForVirtStore ( ) . getEntity ( ) ) { optimizeVolumesForVirtStore ( java.util.Arrays.asList ( volume ) ) ; } } }
Source:
protected java.util.Map [ ] getVmInfo ( java.util.List < java.lang.String > vmsToUpdate ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( vdsManager.getVdsId ( ) ) ; return ( ( java.util.Map [ ] ) ( getResourceManager ( ) . runVdsCommand ( VDSCommandType.FullList , new org.ovirt.engine.core.common.vdscommands.FullListVDSCommandParameters ( vds , vmsToUpdate ) ) . getReturnValue ( ) ) ) ; }

Target:
protected java.util.Map [ ] getVmInfo ( java.util.List < java.lang.String > vmsToUpdate ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( vdsManager.getVdsId ( ) ) ; java.util.Map [ ] result = new java.util.Map [ ] { } ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = getResourceManager ( ) . runVdsCommand ( VDSCommandType.FullList , new org.ovirt.engine.core.common.vdscommands.FullListVDSCommandParameters ( vds , vmsToUpdate ) ) ; if ( vdsReturnValue.getSucceeded ( ) ) { result = ( ( java.util.Map [ ] ) ( vdsReturnValue.getReturnValue ( ) ) ) ; } return result ; }
Source:
public void copyDetailsFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volumeAdvancedDetails ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails newBrickDetails : volumeAdvancedDetails.getBrickDetails ( ) ) { org.ovirt.engine.core.compat.Guid newBrickId = newBrickDetails.getBrickProperties ( ) . getBrickId ( ) ; if ( newBrickId != null ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails brickDetails : getBrickDetails ( ) ) { if ( newBrickId.equals ( brickDetails.getBrickProperties ( ) . getBrickId ( ) ) ) { copyBrickProperties ( newBrickDetails.getBrickProperties ( ) , brickDetails.getBrickProperties ( ) ) ; break ; } } } } }

Target:
public void copyDetailsFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails volumeAdvancedDetails ) { setCapacityInfo ( volumeAdvancedDetails.getCapacityInfo ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails newBrickDetails : volumeAdvancedDetails.getBrickDetails ( ) ) { org.ovirt.engine.core.compat.Guid newBrickId = newBrickDetails.getBrickProperties ( ) . getBrickId ( ) ; if ( newBrickId != null ) { for ( org.ovirt.engine.core.common.businessentities.gluster.BrickDetails brickDetails : getBrickDetails ( ) ) { if ( newBrickId.equals ( brickDetails.getBrickProperties ( ) . getBrickId ( ) ) ) { copyBrickProperties ( newBrickDetails.getBrickProperties ( ) , brickDetails.getBrickProperties ( ) ) ; break ; } } } } }
Source:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; cmd.poolPerDc = macPoolPerDc ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }
Source:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "Task ID: '{0}' is in state {1}. End action for command {2} will proceed when all the entity's tasks are completed." , task.getVdsmTaskId ( ) , task.getState ( ) , getCommandId ( ) ) ; return false ; } } } return true ; }

Target:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.CommandAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.CommandAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "Task ID: '{0}' is in state {1}. End action for command {2} will proceed when all the entity's tasks are completed." , task.getVdsmTaskId ( ) , task.getState ( ) , getCommandId ( ) ) ; return false ; } } } return true ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateFloppy ( ) { if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( runVmParam.getFloppyPath ( ) ) ) && ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isFloppySupported ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_FLOPPY_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateFloppy ( ) { if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( runVmParam.getFloppyPath ( ) ) ) && ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isFloppySupported ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_FLOPPY_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangeable ( true ) ; getGlusterHostPassword ( ) . setIsChangeable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangeable ( false ) ; getGlusterHostPassword ( ) . setIsChangeable ( false ) ; } }
Source:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.info ( "ResourceManager::vdsNotResponding entered for Host '{}', '{}'" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; moveBricksToUnknown ( vds ) ; }

Target:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.info ( "ResourceManager::vdsNotResponding entered for Host '{}', '{}'" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) ) ; backend.runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; moveBricksToUnknown ( vds ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.dao.qos.QosDao < ? > getQosDao ( ) { org.ovirt.engine.core.common.businessentities.qos.QosType qosType = getParameters ( ) . getQosType ( ) ; if ( qosType == null ) { qosType = org.ovirt.engine.core.common.businessentities.qos.QosType.STORAGE ; } switch ( qosType ) { case STORAGE : qosDao = getDbFacade ( ) . getStorageQosDao ( ) ; break ; default : break ; } return qosDao ; }

Target:
protected org.ovirt.engine.core.dao.qos.QosDao < ? > getQosDao ( ) { org.ovirt.engine.core.common.businessentities.qos.QosType qosType = getParameters ( ) . getQosType ( ) ; if ( qosType == null ) { return getDbFacade ( ) . getQosBaseDao ( ) ; } switch ( qosType ) { case STORAGE : qosDao = getDbFacade ( ) . getStorageQosDao ( ) ; break ; default : log.debugFormat ( "Not handled QoS type: {0}" , qosType ) ; break ; } return qosDao ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.StorageDomain o1 , org.ovirt.engine.core.common.businessentities.StorageDomain o2 ) { return ( o1.getLastTimeUsedAsMaster ( ) ) < ( o2.getLastTimeUsedAsMaster ( ) ) ? - 1 : ( o1.getLastTimeUsedAsMaster ( ) ) == ( o2.getLastTimeUsedAsMaster ( ) ) ? 0 : 1 ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.StorageDomain o1 , org.ovirt.engine.core.common.businessentities.StorageDomain o2 ) { return java.lang.Long.compare ( o1.getLastTimeUsedAsMaster ( ) , o2.getLastTimeUsedAsMaster ( ) ) ; }
Source:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.simple.ParameterizedRowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeReadAndReturnMap ( procedureName , mapper , parameterSource ) ; java.util.List < ? > resultList = ( ( java.util.List < ? > ) ( resultsMap.get ( BaseDAODbFacade.RETURN_VALUE_PARAMETER ) ) ) ; return resultList != null ? ( ( java.util.List < T > ) ( resultList ) ) : null ; }

Target:
public < T > java.util.List < T > executeReadList ( final java.lang.String procedureName , final org.springframework.jdbc.core.RowMapper < T > mapper , final org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource ) { java.util.Map < java.lang.String , java.lang.Object > resultsMap = executeReadAndReturnMap ( procedureName , mapper , parameterSource ) ; java.util.List < ? > resultList = ( ( java.util.List < ? > ) ( resultsMap.get ( BaseDAODbFacade.RETURN_VALUE_PARAMETER ) ) ) ; return resultList != null ? ( ( java.util.List < T > ) ( resultList ) ) : null ; }
Source:
protected boolean canDoAction ( ) { if ( getParameters ( ) . getPubKeys ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_NO_PUB_KEYS_PASSED ) ; } if ( ( getParameters ( ) . getId ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( getParameters ( ) . getPubKeys ( ) . isEmpty ( ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_NO_PUB_KEYS_PASSED ) ; } if ( ( getParameters ( ) . getId ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; } return super . canDoAction ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult notRemovingUsedPool ( ) { final org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDao = getDbFacade ( ) . getStoragePoolDao ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ; final java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "DATACENTERS_USING_MAC_POOL" , dataCenters ) ; replacements.add ( VdcBllMessages.VAR__ENTITIES__DATA_CENTERS.name ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL , replacements.toArray ( new java.lang.String [ 0 ] ) ) . when ( ( ( dataCenters.size ( ) ) != 0 ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult notRemovingUsedPool ( ) { final org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao = getDbFacade ( ) . getStoragePoolDao ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ; final java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "DATACENTERS_USING_MAC_POOL" , dataCenters ) ; replacements.add ( VdcBllMessages.VAR__ENTITIES__DATA_CENTERS.name ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL , replacements.toArray ( new java.lang.String [ 0 ] ) ) . when ( ( ( dataCenters.size ( ) ) != 0 ) ) ; }
Source:
boolean canDoPluginAction ( java.lang.String pluginName ) { org.ovirt.engine.ui.webadmin.plugin.Plugin plugin = getPlugin ( pluginName ) ; boolean pluginInitializingOrInUse = ( plugin != null ) ? ( plugin.isInState ( PluginState.INITIALIZING ) ) || ( plugin.isInState ( PluginState.IN_USE ) ) : false ; return ( canInvokePlugins ) && pluginInitializingOrInUse ; }

Target:
boolean validatePluginAction ( java.lang.String pluginName ) { org.ovirt.engine.ui.webadmin.plugin.Plugin plugin = getPlugin ( pluginName ) ; boolean pluginInitializingOrInUse = ( plugin != null ) ? ( plugin.isInState ( PluginState.INITIALIZING ) ) || ( plugin.isInState ( PluginState.IN_USE ) ) : false ; return ( canInvokePlugins ) && pluginInitializingOrInUse ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVnicProfileDao ( ) ; vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vnicProfile.setName ( "new_profile" ) ; vnicProfile.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; vnicProfile.setNetworkQosId ( FixturesTool.NETWORK_QOS ) ; vnicProfile.setPortMirroring ( false ) ; vnicProfile.setPassthrough ( false ) ; vnicProfile.setNetworkFilterId ( FixturesTool.VNIC_PROFILE_NETWORK_FILTER ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVnicProfileDao ( ) ; vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vnicProfile.setName ( "new_profile" ) ; vnicProfile.setNetworkId ( FixturesTool.NETWORK_ENGINE ) ; vnicProfile.setNetworkQosId ( FixturesTool.NETWORK_QOS ) ; vnicProfile.setPortMirroring ( false ) ; vnicProfile.setPassthrough ( false ) ; vnicProfile.setNetworkFilterId ( FixturesTool.VNIC_PROFILE_NETWORK_FILTER ) ; vnicProfile.setMigratable ( true ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getMacPoolId ( ) { return getMacPool ( ) . getId ( ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; return ( ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) . macPoolExists ( ) ) ) && ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) . hasUniqueName ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( oldMacPool , getMacPoolEntity ( ) ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > getNonBlankBaseTemplates ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > baseTemplates = filterNotBaseTemplates ( templates ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate baseTemplate : baseTemplates ) { if ( Guid.Empty.equals ( baseTemplate.getId ( ) ) ) { baseTemplates.remove ( baseTemplate ) ; break ; } } return baseTemplates ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmTemplate createLatestTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { org.ovirt.engine.core.common.businessentities.VmTemplate latestTemplate = new org.ovirt.engine.core.common.businessentities.VmTemplate ( template ) ; latestTemplate.setTemplateVersionName ( constants.latestTemplateVersionName ( ) ) ; latestTemplate.setDescription ( constants.latestTemplateVersionDescription ( ) ) ; return latestTemplate ; }
Source:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getDescription ( ) , disk.getLastModifiedDate ( ) , disk.getAppList ( ) ) ) ; } }

Target:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getDescription ( ) , disk.getLastModifiedDate ( ) , disk.getAppList ( ) ) ) ; } }