auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static 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 static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
private void assertDnsProperties ( java.util.Map < java.lang.String , java.lang.Object > actualMetaData ) { org.junit.Assert.assertThat ( actualMetaData , org.hamcrest.Matchers.hasKey ( "network-interfaces" ) ) ; final java.lang.String networkInterfaces = ( ( java.lang.String ) ( actualMetaData.get ( "network-interfaces" ) ) ) ; org.junit.Assert.assertThat ( networkInterfaces , org.hamcrest.Matchers.stringContainsInOrder ( java.util.Arrays.asList ( ( ( "iface " + ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IFACE_NAME ) ) + " inet static\n" ) , ( ( " dns-nameservers " + ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.DNS_SERVERS ) ) + "\n" ) , ( ( " dns-search " + ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.DNS_SEARCH ) ) + "\n" ) ) ) ) ; }

Target:
private void assertDnsProperties ( java.util.Map < java.lang.String , java.lang.Object > actualMetaData ) { org.hamcrest.MatcherAssert.assertThat ( actualMetaData , org.hamcrest.Matchers.hasKey ( "network-interfaces" ) ) ; final java.lang.String networkInterfaces = ( ( java.lang.String ) ( actualMetaData.get ( "network-interfaces" ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( networkInterfaces , org.hamcrest.Matchers.stringContainsInOrder ( java.util.Arrays.asList ( ( ( "iface " + ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.IFACE_NAME ) ) + " inet static\n" ) , ( ( " dns-nameservers " + ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.DNS_SERVERS ) ) + "\n" ) , ( ( " dns-search " + ( org.ovirt.engine.core.vdsbroker.vdsbroker.CloudInitHandlerTest.DNS_SEARCH ) ) + "\n" ) ) ) ) ; }
Source:
protected void getPKITrustV1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { org.ovirt.engine.core.services.RegisterServlet.log.info ( java.lang.String.format ( "PKI Trust request: source='%s', secured='%s'" , request.getRemoteHost ( ) , request.isSecure ( ) ) ) ; try ( java.io.PrintWriter out = response.getWriter ( ) ) { response.setContentType ( PKIResources.Resource.CACertificate.getContentType ( PKIResources.Format.X509_PEM_CA ) ) ; out.print ( PKIResources.Resource.CACertificate.toString ( PKIResources.Format.X509_PEM_CA ) ) ; } }

Target:
protected void getPKITrustV1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { org.ovirt.engine.core.services.RegisterServlet.log.info ( "PKI Trust request: source='{}', secured='{}'" , request.getRemoteHost ( ) , request.isSecure ( ) ) ; try ( java.io.PrintWriter out = response.getWriter ( ) ) { response.setContentType ( PKIResources.Resource.CACertificate.getContentType ( PKIResources.Format.X509_PEM_CA ) ) ; out.print ( PKIResources.Resource.CACertificate.toString ( PKIResources.Format.X509_PEM_CA ) ) ; } }
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 ) { updateFencingPolicyContent ( ( ( getVersion ( ) ) == null ? null : getVersion ( ) . getSelectedItem ( ) ) ) ; }

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 ) { java.lang.Boolean entity = getAllowOverbooking ( ) . getEntity ( ) ; if ( entity ) { getOptimizeForUtilization ( ) . setEntity ( true ) ; } getOptimizeForSpeed ( ) . setIsChangeable ( ( ! entity ) ) ; }
Source:
private boolean validateServers ( java.util.Set < java.lang.String > serverNames ) { for ( java.lang.String serverName : serverNames ) { if ( ( ( getVdsStaticDao ( ) . getByHostName ( serverName ) ) != null ) || ( ( getVdsStaticDao ( ) . getAllWithIpAddress ( serverName ) . size ( ) ) > 0 ) ) { return false ; } } return true ; }

Target:
private boolean validateServers ( java.util.Set < java.lang.String > serverNames ) { for ( java.lang.String serverName : serverNames ) { if ( ( ( vdsStaticDao.getByHostName ( serverName ) ) != null ) || ( ( vdsStaticDao.getAllWithIpAddress ( serverName ) . size ( ) ) > 0 ) ) { return false ; } } return true ; }
Source:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { determineMigrationFailureForAuditLog ( ) ; setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { failedToMigrate ( ) ; _isRerun = true ; } }

Target:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; determineMigrationFailureForAuditLog ( ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { setDestinationVdsId ( null ) ; super . rerun ( ) ; } else { org.ovirt.engine.core.bll.MigrateVmCommand.runningFailed ( ) ; _isRerun = true ; } }
Source:
public void setIsDatacenterAvailable ( java.lang.Boolean value ) { if ( ( ( isDatacenterAvailable ) == null ) && ( value == null ) ) { return ; } if ( ( ( isDatacenterAvailable ) == null ) || ( ! ( isDatacenterAvailable.equals ( value ) ) ) ) { isDatacenterAvailable = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "IsDatacenterAvailable" ) ) ; } }

Target:
public void setIsDatacenterAvailable ( java.lang.Boolean value ) { if ( ( ( isDatacenterAvailable ) == null ) && ( value == null ) ) { return ; } if ( ( ( isDatacenterAvailable ) == null ) || ( ! ( isDatacenterAvailable.equals ( value ) ) ) ) { isDatacenterAvailable = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsDatacenterAvailable" ) ) ; } }
Source:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter comp = new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; java.lang.System.out.println ( comps ) ; assertTrue ( "Monday" , ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) ) ; assertTrue ( "mace" , comps.contains ( "mace" ) ) ; }

Target:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter comp = new org.ovirt.engine.core.searchbackend.DateEnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; java.lang.System.out.println ( comps ) ; org.junit.Assert.assertTrue ( "Monday" , ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) ) ; org.junit.Assert.assertTrue ( "mace" , comps.contains ( "mace" ) ) ; }
Source:
protected void handleVdsErrors ( org.ovirt.engine.core.common.AuditLogType errType , java.util.List < java.lang.String > errors ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( errors ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( org.apache.commons.lang.StringUtils.join ( errors , SystemUtils.LINE_SEPARATOR ) ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setError ( null ) ; }

Target:
protected void propagateFailure ( org.ovirt.engine.core.common.AuditLogType errType , java.util.List < java.lang.String > errors ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( errors ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( org.apache.commons.lang.StringUtils.join ( errors , SystemUtils.LINE_SEPARATOR ) ) ; }
Source:
private void clusterSelectedItemChanged ( ) { if ( ( getCluster ( ) . getSelectedItem ( ) ) != null ) { getAddBricksCommand ( ) . setIsExecutionAllowed ( true ) ; } else { getAddBricksCommand ( ) . setIsExecutionAllowed ( false ) ; } setBricks ( new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hostList ) { if ( ( host.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { getAddBricksCommand ( ) . setIsExecutionAllowed ( true ) ; return ; } } getAddBricksCommand ( ) . setIsExecutionAllowed ( false ) ; setMessage ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . volumeEmptyClusterValidationMsg ( ) ) ; }
Source:
public void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getNumberOfVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfVmsInClusterByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
private void handleLogout ( java.lang.String accessToken , javax.servlet.http.HttpServletResponse response ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = backend.runInternalAction ( ActionType.TerminateSessionsForToken , new org.ovirt.engine.core.common.action.TerminateSessionsForTokenParameters ( accessToken ) ) ; if ( returnValue.getSucceeded ( ) ) { response.setStatus ( java.net.HttpURLConnection.HTTP_OK ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' succeeded" , accessToken ) ; } else { response.setStatus ( java.net.HttpURLConnection.HTTP_INTERNAL_ERROR ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' failed" , accessToken ) ; } }

Target:
private void handleLogout ( java.lang.String accessToken , javax.servlet.http.HttpServletResponse response ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = backend.runInternalAction ( ActionType.TerminateSessionsForToken , new org.ovirt.engine.core.common.action.TerminateSessionsForTokenParameters ( accessToken ) ) ; if ( returnValue.getSucceeded ( ) ) { response.setStatus ( java.net.HttpURLConnection.HTTP_OK ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' succeeded" , accessToken ) ; } else { response.setStatus ( java.net.HttpURLConnection.HTTP_INTERNAL_ERROR ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Invalidate Sessions for access token '{}' failed" , accessToken ) ; } }
Source:
protected void createVirtIODisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = getDiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setActive ( true ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.HashSet < > ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.DISK_HOTPLUGGABLE_INTERFACES ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage mockDiskImage ( ) { disk.setImageId ( diskImageGuid ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > storageIdList = new java.util.ArrayList < > ( ) ; storageIdList.add ( storageDomainId ) ; disk.setStorageIds ( storageIdList ) ; disk.setStoragePoolId ( storagePoolId ) ; disk.setActive ( true ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; return disk ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; } } ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ; params.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , params , asyncQuery ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.queries.SearchParameters tempVar = new org.ovirt.engine.core.common.queries.SearchParameters ( getSearchString ( ) , org.ovirt.engine.core.common.interfaces.SearchType.Provider ) ; tempVar.setMaxCount ( getSearchPageSize ( ) ) ; super . syncSearch ( VdcQueryType.Search , tempVar ) ; }
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 ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) ) { 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.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }
Source:
public org.ovirt.engine.api.model.RngDevice adapt ( org.ovirt.engine.api.v3.types.V3RngDevice from ) { org.ovirt.engine.api.model.RngDevice to = new org.ovirt.engine.api.model.RngDevice ( ) ; if ( from.isSetRate ( ) ) { to.setRate ( org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( from.getRate ( ) ) ) ; } if ( from.isSetSource ( ) ) { to.setSource ( from.getSource ( ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.model.RngDevice adapt ( org.ovirt.engine.api.v3.types.V3RngDevice from ) { org.ovirt.engine.api.model.RngDevice to = new org.ovirt.engine.api.model.RngDevice ( ) ; if ( from.isSetRate ( ) ) { to.setRate ( org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( from.getRate ( ) ) ) ; } if ( from.isSetSource ( ) ) { to.setSource ( org.ovirt.engine.api.model.RngSource.fromValue ( from.getSource ( ) ) ) ; } return to ; }
Source:
protected org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource getParamsSource ( org.ovirt.engine.core.common.businessentities.tags tag ) { org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource paramsSource = new org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource ( dbFacade.getDbEngineDialect ( ) ) ; paramsSource.addValue ( "description" , tag.getdescription ( ) ) . addValue ( "tag_id" , tag.gettag_id ( ) ) . addValue ( "tag_name" , tag.gettag_name ( ) ) . addValue ( "parent_id" , tag.getparent_id ( ) ) . addValue ( "readonly" , tag.getIsReadonly ( ) ) . addValue ( "type" , tag.gettype ( ) ) ; return paramsSource ; }

Target:
protected org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource getParamsSource ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource paramsSource = new org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource ( dbFacade.getDbEngineDialect ( ) ) ; paramsSource.addValue ( "description" , tag.getdescription ( ) ) . addValue ( "tag_id" , tag.gettag_id ( ) ) . addValue ( "tag_name" , tag.gettag_name ( ) ) . addValue ( "parent_id" , tag.getparent_id ( ) ) . addValue ( "readonly" , tag.getIsReadonly ( ) ) . addValue ( "type" , tag.gettype ( ) ) ; return paramsSource ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotCreate ( volumeName , snapshotName , description , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigReset ( volumeName , slaveHost , slaveVolumeName , configKey ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testInValidUpdateOfStatusRestrictedEditableFieldOnRunningVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setSingleQxlPci ( true ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setSingleQxlPci ( false ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest , VMStatus.Up , false ) ; org.junit.Assert.assertFalse ( "Update should be invalid for different single QXL PCI statuses on a running VM" , updateIsValid ) ; }

Target:
public void testInValidUpdateOfStatusRestrictedEditableFieldOnRunningVm ( ) { org.ovirt.engine.core.common.businessentities.VmStatic src = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; src.setSingleQxlPci ( true ) ; org.ovirt.engine.core.common.businessentities.VmStatic dest = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; dest.setSingleQxlPci ( false ) ; boolean updateIsValid = vmHandler.isUpdateValid ( src , dest , VMStatus.Up , false ) ; org.junit.jupiter.api.Assertions.assertFalse ( updateIsValid , "Update should be invalid for different single QXL PCI statuses on a running VM" ) ; }
Source:
public void testUpdateWithNonExistingNetwork ( ) throws java.lang.Exception { setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getUpdate ( true ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdateWrongPortMirroringNetwork ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = getNic ( false ) ; nic.getPortMirroring ( ) . getNetworks ( ) . getNetworks ( ) . get ( 0 ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; nic = resource.update ( nic ) ; assertNotNull ( nic ) ; }
Source:
protected void disconnectAllHostsInPool ( ) { ( ( org.ovirt.engine.core.common.eventqueue.EventQueue ) ( org.ovirt.engine.core.utils.ejb.EjbUtils.findBean ( BeanType.EVENTQUEUE_MANAGER , BeanProxyType.LOCAL ) ) ) . submitEventSync ( new org.ovirt.engine.core.common.eventqueue.Event ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getParameters ( ) . getStorageDomainId ( ) , null , org.ovirt.engine.core.common.eventqueue.EventType.POOLREFRESH , "" ) , new java.util.concurrent.Callable < org.ovirt.engine.core.common.eventqueue.EventResult > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { runSynchronizeOperation ( new org.ovirt.engine.core.bll.storage.RefreshStoragePoolAndDisconnectAsyncOperationFactory ( ) ) ; return null ; } } ) ; }

Target:
protected void disconnectAllHostsInPool ( ) { getEventQueue ( ) . submitEventSync ( new org.ovirt.engine.core.common.eventqueue.Event ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getParameters ( ) . getStorageDomainId ( ) , null , org.ovirt.engine.core.common.eventqueue.EventType.POOLREFRESH , "" ) , new java.util.concurrent.Callable < org.ovirt.engine.core.common.eventqueue.EventResult > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { runSynchronizeOperation ( new org.ovirt.engine.core.bll.storage.RefreshStoragePoolAndDisconnectAsyncOperationFactory ( ) ) ; return null ; } } ) ; }
Source:
private void initComparators ( ) { java.util.List < ? extends java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > comparators = java.util.Arrays.asList ( new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.SmallestStorageDomainComparator ( validStorageDomain2 ) , new org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.BiggestStorageDomainComparator ( validStorageDomain3 ) ) ; org.mockito.Mockito.doReturn ( comparators ) . when ( memoryStorageHandler ) . getStorageDomainComparators ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
private void initComparators ( ) { java.util.List < java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > comparators = java.util.Arrays.asList ( java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.StorageDomain sd ) -> sd.equals ( validStorageDomain2 ) ) , java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.StorageDomain sd ) -> sd.equals ( validStorageDomain3 ) ) . reversed ( ) ) ; org.mockito.Mockito.doReturn ( comparators ) . when ( memoryStorageHandler ) . getStorageDomainComparators ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public void testParseStrayCommas ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:,,one=1,,,two=2,,three=3,," , "one=bool,two=int,three=bool" ) ; org.junit.Assert.assertNotNull ( ret ) ; org.junit.Assert.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; }

Target:
public void testParseStrayCommas ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:,,one=1,,,two=2,,three=3,," , "one=bool,two=int,three=bool" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( ret ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void clusterHasVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSupportedClusterLevels ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1.toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void clusterHasVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSupportedClusterLevels ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1.toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }
Source:
public static 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 ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { java.util.List < java.lang.String > vmIds = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.getParameters ( ) . getVmIds ( ) ; java.lang.String [ ] vmIdsArray = vmIds.toArray ( new java.lang.String [ vmIds.size ( ) ] ) ; fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.getBroker ( ) . list ( java.lang.Boolean.TRUE.toString ( ) , vmIdsArray ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.mVmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.setReturnValue ( struct ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { java.util.List < java.lang.String > vmIds = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.getParameters ( ) . getVmIds ( ) ; java.lang.String [ ] vmIdsArray = vmIds.toArray ( new java.lang.String [ vmIds.size ( ) ] ) ; fullVmListReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.getBroker ( ) . list ( java.lang.Boolean.TRUE.toString ( ) , vmIdsArray ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.Object > [ ] struct = fullVmListReturn.mVmList ; org.ovirt.engine.core.vdsbroker.vdsbroker.FullListVdsCommand.setReturnValue ( struct ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setname ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setcompatibility_version ( Version.v3_2 ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setcompatibility_version ( Version.v3_2 ) ; return cluster ; }
Source:
public void addTabWidget ( com.google.gwt.user.client.ui.Widget tabWidget , int index ) { mainTabContainer.insert ( tabWidget , index ) ; }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetSearchPanel ) ) { setPanelContent ( searchPanelContainer , content ) ; } else if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetTabBar ) ) { setPanelContent ( mainTabContainer , content ) ; content.asWidget ( ) . addStyleName ( style.mainTabBar ( ) ) ; } else { super . setInSlot ( slot , content ) ; } }
Source:
public boolean validate ( ) { getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getCustomPropertySheet ( ) . validate ( ) ) ; }

Target:
public boolean validate ( ) { getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getCustomPropertySheet ( ) . validate ( ) ) ; }
Source:
public void testClusterLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.CLUSTER_ID ) ; cluster.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; cluster.getDataCenter ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.common.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , cluster ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.CLUSTER_HREF , cluster.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.DATA_CENTER_HREF , cluster.getDataCenter ( ) . getHref ( ) ) ; }

Target:
public void testClusterLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.CLUSTER_ID ) ; cluster.setDataCenter ( new org.ovirt.engine.api.model.DataCenter ( ) ) ; cluster.getDataCenter ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.DATA_CENTER_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , cluster ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.CLUSTER_HREF , cluster.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.DATA_CENTER_HREF , cluster.getDataCenter ( ) . getHref ( ) ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( sshPublicKey ) == null ? 0 : sshPublicKey.hashCode ( ) ) ; result = ( prime * result ) + ( ( loginName ) == null ? 0 : loginName.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( sshPublicKey ) == null ? 0 : sshPublicKey.hashCode ( ) ) ; result = ( prime * result ) + ( ( ( java.lang.Boolean ) ( userPortalVmLoginAutomatically ) ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( loginName ) == null ? 0 : loginName.hashCode ( ) ) ; return result ; }
Source:
protected void initFrontend ( ) { frontend.setEventsHandler ( frontendEventsHandler ) ; frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { user.logout ( ) ; } } ) ; frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }

Target:
public void execute ( ) { frontend.runQuery ( VdcQueryType.GetEngineSessionIdToken , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String engineAuthToken = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; restApiSessionManager.acquireSession ( engineAuthToken ) ; } } ) ) ; }
Source:
public void testInterfaceIsValidSlaveWhenInterfaceIsVlan ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVlanId ( 1 ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testInterfaceIsValidSlaveWhenInterfaceIsBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBonded ( true ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_INTERFACE_NAME , vdsNetworkInterface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , matcher ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( java.lang.String nicName , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , networkName , true , null ) ; }

Target:
public void labeledNetworkRemovedFromUnlabeledNic ( ) { java.lang.String networkName = "net" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , networkName ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( null ) ; mockExistingNetworks ( createLabeledNetwork ( networkName , "lbl1" ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; assertNoNetworksModified ( helper ) ; assertNetworkRemoved ( helper , networkName ) ; }
Source:
void localize ( org.ovirt.engine.ui.common.CommonApplicationConstants constants , org.ovirt.engine.ui.common.CommonApplicationMessages messages , org.ovirt.engine.ui.common.CommonApplicationTemplates templates ) { message1.setHTML ( listItem ( messages.nextRunConfigurationExists ( ) , templates ) ) ; message2.setHTML ( listItem ( messages.nextRunConfigurationCanBeAppliedImmediately ( ) , templates ) ) ; applyCpuLaterEditor.setLabel ( constants.applyLater ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.common.CommonApplicationConstants constants , org.ovirt.engine.ui.common.CommonApplicationMessages messages , org.ovirt.engine.ui.common.CommonApplicationTemplates templates ) { message1.setHTML ( listItem ( messages.nextRunConfigurationExists ( ) , templates ) ) ; message2.setHTML ( listItem ( messages.nextRunConfigurationCanBeAppliedImmediately ( ) , templates ) ) ; applyCpuLaterEditor.setLabel ( constants.applyLater ( ) ) ; changedFieldsExpander.setTitleWhenExpended ( constants.changedFieldsList ( ) ) ; changedFieldsExpander.setTitleWhenCollapsed ( constants.changedFieldsList ( ) ) ; }
Source:
protected boolean validate ( ) { if ( ( hostedEngineHelper.getStorageDomain ( ) ) != null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } if ( ! ( fetchStorageDomainInfo ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES ) . contains ( heStorageDomain.getStorageType ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; } return true ; }

Target:
protected void init ( ) { fetchStorageDomainInfo ( ) ; }
Source:
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 ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs args ) { if ( ev.matchesDefinition ( spiceVersionFileFetchedEvent_Definition ) ) { org.ovirt.engine.core.compat.Version spiceVersion = parseVersion ( args.getFileContent ( ) ) ; setSpiceVersion ( spiceVersion ) ; } else if ( ev.matchesDefinition ( documentationFileFetchedEvent_Definition ) ) { java.lang.String documentationPathFileContent = args.getFileContent ( ) ; org.ovirt.engine.ui.common.uicommon.DocumentationPathTranslator.init ( documentationPathFileContent ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.webadmin.uicommon.FileFetchEventArgs args ) { if ( ev.matchesDefinition ( spiceVersionFileFetchedEvent_Definition ) ) { org.ovirt.engine.core.compat.Version spiceVersion = parseVersion ( args.getFileContent ( ) ) ; setSpiceVersion ( spiceVersion ) ; } else if ( ev.matchesDefinition ( documentationFileFetchedEvent_Definition ) ) { java.lang.String documentationPathFileContent = args.getFileContent ( ) ; org.ovirt.engine.ui.common.uicommon.ContextSensitiveHelpManager.init ( documentationPathFileContent ) ; } }
Source:
public void onSave ( ) { if ( validate ( ) ) { flush ( ) ; getDiskModel ( ) . setEntity ( this ) ; fillData ( ) ; parentModel.getParentListModel ( ) . setWindow ( null ) ; parentModel.getParentListModel ( ) . setWindow ( parentModel.getUnitVmModel ( ) ) ; } }

Target:
public void onSave ( ) { if ( validate ( ) ) { flush ( ) ; getDiskModel ( ) . setEntity ( this ) ; this . setChanged ( true ) ; fillData ( ) ; parentModel.getParentListModel ( ) . setWindow ( null ) ; parentModel.getParentListModel ( ) . setWindow ( parentModel.getUnitVmModel ( ) ) ; } }
Source:
public void canDoActionMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = initDiskImage ( diskImageId ) ; diskImage.setImageTemplateId ( templateDiskId ) ; initDiskImage ( templateDiskId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionMissingTemplateDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = initDiskImage ( diskImageId ) ; diskImage.setImageTemplateId ( templateDiskId ) ; initDiskImage ( templateDiskId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN.toString ( ) ) ) ; }
Source:
public void testGetAllForRoleAndAdElementAndObject ( ) { org.ovirt.engine.core.common.businessentities.Permissions result = dao.getForRoleAndAdElementAndObject ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , result.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , result.getAdElementId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , result.getObjectId ( ) ) ; }

Target:
public void testGetAllForRoleAndAdElementAndObject ( ) { org.ovirt.engine.core.common.businessentities.Permission result = dao.getForRoleAndAdElementAndObject ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , result.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , result.getAdElementId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , result.getObjectId ( ) ) ; }