auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canDoActionCanNotFindTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
private void initSnapshotValidator ( ) { org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( command.getSnapshotsValidator ( ) ) . thenReturn ( snapshotsValidator ) ; }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.EngineError returnStatus = getReturnValueFromStatus ( getReturnStatus ( ) ) ; switch ( returnStatus ) { case GetStorageDomainListError : org.ovirt.engine.core.vdsbroker.irsbroker.GetVolumesListVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetVolumesListVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.EngineError returnStatus = getReturnValueFromStatus ( getReturnStatus ( ) ) ; switch ( returnStatus ) { case GetStorageDomainListError : org.ovirt.engine.core.vdsbroker.irsbroker.GetVolumesListVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , getReturnStatus ( ) . message ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetVolumesListVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; break ; } }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.NETWORK_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.VdsGroupOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVdsGroup , org.ovirt.engine.core.common.action.ManagementNetworkOnClusterOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( vmId ) ; if ( vm != null ) { return ( org.ovirt.engine.core.bll.VM.isStatusUpOrPaused ( vm.getstatus ( ) ) ) || ( ( vm.getstatus ( ) ) == ( VMStatus.Unknown ) ) ; } return false ; }

Target:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( vmId ) ; if ( vm != null ) { return ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( vm.getstatus ( ) ) ) || ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }
Source:
private double getStoredStackPanelWidth ( ) { java.lang.String widthString = clientStorage.getLocalItem ( org.ovirt.engine.ui.webadmin.widget.main.TabbedSplitLayoutPanel.WEST_SPLITTER_KEY ) ; double width = org.ovirt.engine.ui.webadmin.widget.main.TabbedSplitLayoutPanel.DEFAULT_STACK_PANEL_WIDTH ; try { if ( widthString != null ) { width = java.lang.Double.valueOf ( widthString ) ; } } catch ( java.lang.NumberFormatException nfe ) { } return width ; }

Target:
public void onResize ( ) { super . onResize ( ) ; double currentWidth = westPanel.getOffsetWidth ( ) ; setStoredSplitterWidth ( org.ovirt.engine.ui.webadmin.widget.main.TabbedSplitLayoutPanel.WEST_SPLITTER_KEY , currentWidth ) ; determineButtonVisiblity ( ) ; positionLeftCollapseButton ( ) ; }
Source:
public void testNetworkNotAttachedToHost ( ) 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.< org.ovirt.engine.core.common.businessentities.VDS > emptyList ( ) ) ; 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.isValid ( ) ) ; }

Target:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_CHANGE_ATTACHED_NETWORK , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_NETWORK_ATTACHMENT_ID , oldAttachment.getId ( ) ) ) ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "ProviderNetwork [providerId=" ) . append ( getProviderId ( ) ) . append ( ", externalId=" ) . append ( getExternalId ( ) ) . append ( "]" ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "providerId" , getProviderId ( ) ) . append ( "externalId" , getExternalId ( ) ) . build ( ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { return adaptRemove ( getDelegate ( ) :: remove ) ; }

Target:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.v3.types.V3Action action ) { javax.ws.rs.core.Response response = adaptRemove ( getDelegate ( ) :: remove ) ; if ( ( ! ( action.isSetDetach ( ) ) ) || ( ! ( action.isDetach ( ) ) ) ) { org.ovirt.engine.api.resource.DisksResource disksResource = org.ovirt.engine.api.restapi.resource.BackendApiResource.getInstance ( ) . getDisksResource ( ) ; org.ovirt.engine.api.resource.DiskResource diskResource = disksResource.getDiskResource ( id ) ; response = adaptRemove ( diskResource :: remove ) ; } return response ; }
Source:
public int read ( byte [ ] b , int off , int len ) throws java.io.IOException { int ret = super . read ( b , off , len ) ; if ( ret != ( - 1 ) ) { this . index += ret ; } return ret ; }

Target:
public int read ( byte [ ] b , int off , int len ) throws java.io.IOException { int ret = in.read ( b , off , len ) ; if ( ret != ( - 1 ) ) { this . index += ret ; } return ret ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > getGlusterServerHooks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > ( ) ; serverHooks.add ( getGlusterServerHook ( 0 ) ) ; serverHooks.add ( getGlusterServerHook ( 1 ) ) ; serverHooks.add ( getGlusterServerHook ( 2 ) ) ; return serverHooks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > getGlusterServerHooks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > ( ) ; serverHooks.add ( getGlusterServerHook ( 0 , GlusterHookStatus.ENABLED ) ) ; serverHooks.add ( getGlusterServerHook ( 1 , GlusterHookStatus.ENABLED ) ) ; serverHooks.add ( getGlusterServerHook ( 2 , GlusterHookStatus.ENABLED ) ) ; return serverHooks ; }
Source:
void setupDefaultVmStyles ( ) { if ( ! ( isSelected ( ) ) ) { if ( model.isVmUp ( ) ) { getView ( ) . setVmUpStyle ( ) ; } else { getView ( ) . setVmDownStyle ( ) ; } } }

Target:
void setupDefaultVmStyles ( ) { if ( ! ( isSelected ( ) ) ) { if ( ( model.isVmUp ( ) ) && ( ! ( consoleInUse ( ) ) ) ) { getView ( ) . setVmUpStyle ( ) ; } else { getView ( ) . setVmDownStyle ( ) ; } } }
Source:
private void setDisksToBeAttached ( org.ovirt.engine.core.common.businessentities.VM vmFromConfiguration ) { vmDisksToAttach = vmFromConfiguration.getDiskMap ( ) . values ( ) ; clearVmDisks ( vmFromConfiguration ) ; org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getParameters ( ) . setCopyCollapse ( true ) ; }

Target:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; auditLogDirector.log ( this , AuditLogType.VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESSFULLY ) ; } else if ( ! ( vmDisksToAttach.isEmpty ( ) ) ) { auditLogDirector.log ( this , attemptToAttachDisksToImportedVm ( vmDisksToAttach ) ) ; } } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmFromConfigurationCommand.getVm ( ) . getId ( ) ) ; }
Source:
public void postOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; if ( model.getIsNew ( ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; } } }

Target:
public void postOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; if ( model.getIsNew ( ) ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; } } }
Source:
public void unsubscribe ( java.lang.String channel ) { java.lang.String id = this . destinations.remove ( channel ) ; this . transport.send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . unsubscribe ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_ID , id ) . build ( ) , key ) ; this . listener.remove ( channel ) ; }

Target:
public void unsubscribe ( java.lang.String channel ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { java.lang.String id = this . destinations.remove ( channel ) ; this . listener.remove ( channel ) ; this . transport.send ( new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . unsubscribe ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_ID , id ) . build ( ) , key ) ; } }
Source:
private void volumeType_SelectedItemChanged ( ) { if ( ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) || ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( ( org.ovirt.engine.core.common.businessentities.VolumeType ) ( getVolumeType ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) . getstorage_pool_type ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }

Target:
private void volumeType_SelectedItemChanged ( ) { if ( ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) || ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( ( org.ovirt.engine.core.common.businessentities.VolumeType ) ( getVolumeType ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) . getStorageType ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }
Source:
public void testUpdateClustersProps ( ) { org.junit.Assert.assertNotSame ( "pc-1.2.3" , existingCluster.getEmulatedMachine ( ) ) ; existingCluster.setEmulatedMachine ( "pc-1.2.3" ) ; dao.update ( existingCluster ) ; org.junit.Assert.assertEquals ( "pc-1.2.3" , existingCluster.getEmulatedMachine ( ) ) ; existingCluster.setDetectEmulatedMachine ( true ) ; dao.update ( existingCluster ) ; org.junit.Assert.assertEquals ( true , existingCluster.isDetectEmulatedMachine ( ) ) ; }

Target:
public void testUpdateClustersProps ( ) { org.junit.Assert.assertNotSame ( "pc-1.2.3" , existingCluster.getEmulatedMachine ( ) ) ; existingCluster.setEmulatedMachine ( "pc-1.2.3" ) ; dao.update ( existingCluster ) ; org.junit.Assert.assertEquals ( "pc-1.2.3" , existingCluster.getEmulatedMachine ( ) ) ; existingCluster.setDetectEmulatedMachine ( true ) ; dao.update ( existingCluster ) ; org.junit.Assert.assertTrue ( existingCluster.isDetectEmulatedMachine ( ) ) ; }
Source:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAO ) ; returnedPermissions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; org.ovirt.engine.core.common.businessentities.permissions permissions = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; returnedPermissions.add ( permissions ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( permissionDAO.getConsumedPermissionsForQuotaId ( quotaId ) ) . thenReturn ( returnedPermissions ) ; }

Target:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDAO ) ; returnedPermissions = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; org.ovirt.engine.core.common.businessentities.Permissions permissions = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; returnedPermissions.add ( permissions ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( permissionDAO.getConsumedPermissionsForQuotaId ( quotaId ) ) . thenReturn ( returnedPermissions ) ; }
Source:
private void mockVmStatic ( boolean stubExists ) { org.mockito.Mockito.reset ( vmStaticDao ) ; org.mockito.Mockito.when ( vmStaticDao.get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.mockito.Matchers.anyObject ( ) ) ) ) ) . thenReturn ( ( stubExists ? org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) : null ) ) ; }

Target:
private void mockVmStatic ( boolean stubExists ) { org.mockito.Mockito.reset ( vmStaticDao ) ; org.mockito.Mockito.when ( vmStaticDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ( stubExists ? org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) : null ) ) ; }
Source:
private boolean stopSuspendedVm ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setVm ( null ) ; final org.ovirt.engine.core.common.businessentities.VMStatus vmStatus = org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ; if ( vmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { return false ; } updateVmStatus ( VMStatus.ImageLocked ) ; if ( ! ( removeHibernationDisks ( ) ) ) { updateVmStatus ( vmStatus ) ; return false ; } return true ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) == null ) { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "VM is null, not performing full endAction" ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; return ; } org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterHostListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; setClusterServiceModel ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterServiceModel ( ) ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterHostListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterVmListModel ( ) ) ; list.add ( getClusterServiceModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }
Source:
public void render ( org.ovirt.engine.ui.userportal.widget.extended.vm.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.appendHtmlConstant ( ( ( ( ( "<div id=\"" + ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) ) ) + "\" title=\"" ) + ( com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( provider.getTooltip ( value ) ) ) ) + "\">" ) ) ; super . render ( context , value , sb , hasCell ) ; sb.appendHtmlConstant ( "</div>" ) ; }

Target:
public void render ( org.ovirt.engine.ui.userportal.widget.extended.vm.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { java.lang.String tooltip = provider.getTooltip ( value ) ; if ( tooltip == null ) { tooltip = "" ; } sb.appendHtmlConstant ( ( ( ( ( "<div id=\"" + ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) ) ) + "\" title=\"" ) + ( com.google.gwt.safehtml.shared.SafeHtmlUtils.htmlEscape ( tooltip ) ) ) + "\">" ) ) ; super . render ( context , value , sb , hasCell ) ; sb.appendHtmlConstant ( "</div>" ) ; }
Source:
void onUploadIconButton ( com.google.gwt.event.dom.client.ClickEvent event ) { hiddenPanel.clear ( ) ; final com.google.gwt.user.client.ui.FileUpload inputFileWidget = new com.google.gwt.user.client.ui.FileUpload ( ) ; inputFileWidget.getElement ( ) . setAttribute ( "accept" , "image/gif,image/jpeg,image/png" ) ; inputFileWidget.addChangeHandler ( new com.google.gwt.event.dom.client.ChangeHandler ( ) { @ java.lang.Override public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { readUploadedIconFile ( inputFileWidget.getElement ( ) ) ; } } ) ; inputFileWidget.getElement ( ) . setTabIndex ( ( - 1 ) ) ; hiddenPanel.add ( inputFileWidget ) ; clickElement ( inputFileWidget.getElement ( ) ) ; }

Target:
void onUploadIconButton ( com.google.gwt.event.dom.client.ClickEvent event ) { hiddenPanel.clear ( ) ; final com.google.gwt.user.client.ui.FileUpload inputFileWidget = new com.google.gwt.user.client.ui.FileUpload ( ) ; inputFileWidget.getElement ( ) . setAttribute ( "accept" , "image/gif,image/jpeg,image/png" ) ; inputFileWidget.addChangeHandler ( new com.google.gwt.event.dom.client.ChangeHandler ( ) { @ java.lang.Override public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { readUploadedIconFile ( inputFileWidget.getElement ( ) ) ; } } ) ; inputFileWidget.getElement ( ) . setTabIndex ( ( - 1 ) ) ; hiddenPanel.add ( inputFileWidget ) ; inputFileWidget.click ( ) ; }
Source:
public void testVmTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.TAG_ID ) ; tag.setVm ( new org.ovirt.engine.api.model.VM ( ) ) ; tag.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.common.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , tag ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_TAG_HREF , tag.getHref ( ) ) ; }

Target:
public void testVmTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.TAG_ID ) ; tag.setVm ( new org.ovirt.engine.api.model.VM ( ) ) ; tag.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , tag ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_TAG_HREF , tag.getHref ( ) ) ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void onSuccess ( ) { ovfDataUpdater.triggerNow ( ) ; }

Target:
private void updateHeOvf ( ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { ovfDataUpdater.triggerNow ( ) ; return ; } org.ovirt.engine.core.bll.VmCommand.registerRollbackHandler ( ( ( org.ovirt.engine.core.utils.transaction.TransactionSuccessListener ) ( ( ) -> ovfDataUpdater.triggerNow ( ) ) ) ) ; }
Source:
public static void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_6 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_6 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
public void initialize ( ) { super . initialize ( ) ; if ( ( getVm ( ) ) != null ) { updateSuggestedDiskAlias ( ) ; getIsPlugged ( ) . setIsAvailable ( true ) ; } else { getIsReadOnly ( ) . setIsAvailable ( false ) ; getIsPlugged ( ) . setEntity ( false ) ; } getSizeExtend ( ) . setIsAvailable ( false ) ; }

Target:
public void initialize ( ) { super . initialize ( ) ; if ( ( getVm ( ) ) != null ) { updateSuggestedDiskAliasFromServer ( ) ; getIsPlugged ( ) . setIsAvailable ( true ) ; } else { getIsReadOnly ( ) . setIsAvailable ( false ) ; getIsPlugged ( ) . setEntity ( false ) ; getIsUsingScsiReservation ( ) . setIsAvailable ( false ) ; getIsUsingScsiReservation ( ) . setEntity ( false ) ; } getSizeExtend ( ) . setIsAvailable ( false ) ; }
Source:
public java.net.URI constructURI ( java.lang.String protocol , java.lang.String address , java.lang.String defaultLdapSeverPort ) throws java.net.URISyntaxException { java.lang.String [ ] parts = address.split ( "\\:" ) ; java.lang.String hostname = address ; java.lang.String port = defaultLdapSeverPort ; if ( ( parts.length ) == 2 ) { hostname = parts [ 0 ] ; port = parts [ 1 ] ; } else { if ( port == null ) { throw new java.lang.IllegalArgumentException ( "the address in SRV record should contain host and port" ) ; } } java.lang.StringBuilder uriSB = new java.lang.StringBuilder ( protocol ) ; uriSB.append ( "://" ) . append ( hostname ) . append ( ":" ) . append ( port ) ; return new java.net.URI ( uriSB.toString ( ) ) ; }

Target:
public java.net.URI constructURI ( java.lang.String protocol , java.lang.String address , java.lang.String defaultLdapSeverPort ) throws java.net.URISyntaxException { address = ( ( address.indexOf ( "://" ) ) != ( - 1 ) ) ? address.substring ( ( ( address.indexOf ( "://" ) ) + 3 ) ) : address ; java.lang.String [ ] parts = address.split ( "\\:" ) ; java.lang.String hostname = address ; java.lang.String port = defaultLdapSeverPort ; if ( ( parts.length ) == 2 ) { hostname = parts [ 0 ] ; port = parts [ 1 ] ; } else { if ( port == null ) { throw new java.lang.IllegalArgumentException ( "the address in SRV record should contain host and port" ) ; } } java.lang.StringBuilder uriSB = new java.lang.StringBuilder ( protocol ) ; uriSB.append ( "://" ) . append ( hostname ) . append ( ":" ) . append ( port ) ; return new java.net.URI ( uriSB.toString ( ) ) ; }
Source:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( getView ( ) . addMouseOutHandler ( this ) ) ; registerHandler ( getView ( ) . addMouseOverHandler ( this ) ) ; registerHandler ( getView ( ) . addClickHandler ( this ) ) ; registerHandler ( getView ( ) . addDoubleClickHandler ( this ) ) ; }

Target:
protected void onUnbind ( ) { super . onUnbind ( ) ; removeSelectedItemChangeHandler ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "Progress" . equals ( pcArgs.propertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( PropertyChangedEventArgs.Args.PROGRESS.toString ( ) . equals ( pcArgs.propertyName ) ) { if ( ( modelProvider.getModel ( ) . getProgress ( ) ) != null ) { if ( ( getTable ( ) ) != null ) { getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; } } } }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.Executed ( f ) ; org.ovirt.engine.ui.frontend.Frontend.raiseQueryCompleteEvent ( queryTypeList , context ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.executed ( f ) ; org.ovirt.engine.ui.frontend.Frontend.raiseQueryCompleteEvent ( queryTypeList , context ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc convertOva ( java.lang.String ovaPath , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.convertOva" ) . withParameter ( "ova_path" , ovaPath ) . withParameter ( "vminfo" , vm ) . withParameter ( "jobid" , jobUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc convertVmFromOva ( java.lang.String ovaPath , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.convertExternalVmFromOva" ) . withParameter ( "ova_path" , ovaPath ) . withParameter ( "vminfo" , vm ) . withParameter ( "jobid" , jobUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void updateCommandStatus ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.compat.CommandStatus status ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCommandStatus ( status ) ; if ( taskType.equals ( AsyncTaskType.notsupported ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; } } }

Target:
public void updateCallBackNotified ( org.ovirt.engine.core.compat.Guid commandId ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCallBackNotified ( true ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . updateNotified ( commandId ) ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult ( queryType , parameters , null ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.OnFailure ( f ) ; }

Target:
public static org.ovirt.engine.ui.frontend.FrontendLoginHandler getLoginHandler ( ) { return org.ovirt.engine.ui.frontend.Frontend.loginHandler ; }
Source:
private org.ovirt.engine.core.common.businessentities.AuditLogEvent createDBDownEvent ( ) { final org.ovirt.engine.core.common.businessentities.AuditLogEvent dbDownEvent = new org.ovirt.engine.core.common.businessentities.AuditLogEvent ( ) ; dbDownEvent.setLogTime ( new java.util.Date ( ) ) ; dbDownEvent.setType ( AuditLogEventType.alertMessage ) ; dbDownEvent.setLogTypeName ( "DATABASE_UNREACHABLE" ) ; dbDownEvent.setMessage ( "Failed to query for notifications. Database Connection refused." ) ; dbDownEvent.setSeverity ( AuditLogSeverity.ERROR ) ; return dbDownEvent ; }

Target:
public org.ovirt.engine.core.notifier.filter.AuditLogEvent createDBDownEvent ( ) { final org.ovirt.engine.core.notifier.filter.AuditLogEvent dbDownEvent = new org.ovirt.engine.core.notifier.filter.AuditLogEvent ( ) ; dbDownEvent.setLogTime ( new java.util.Date ( ) ) ; dbDownEvent.setType ( AuditLogEventType.alertMessage ) ; dbDownEvent.setLogTypeName ( org.ovirt.engine.core.notifier.dao.EventsManager.DATABASE_UNREACHABLE ) ; dbDownEvent.setMessage ( "Failed to query for notifications. Database Connection refused." ) ; dbDownEvent.setSeverity ( AuditLogSeverity.ERROR ) ; return dbDownEvent ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > ( ) ; for ( java.lang.String groupFullName : getEntity ( ) . getGroupNames ( ) ) { items.add ( createUserGroup ( groupFullName , getEntity ( ) . getNamespace ( ) , getEntity ( ) . getDomain ( ) ) ) ; } setItems ( items ) ; } else { setItems ( null ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { for ( org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup grp : ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( returnValue ) ) ) { items.add ( createUserGroup ( grp.getName ( ) , grp.getNamespace ( ) , grp.getAuthz ( ) ) ) ; } setItems ( items ) ; }
Source:
private java.lang.Boolean isNfsStatistics ( ) { if ( ( ( getUriInfo ( ) ) != null ) && ( org.ovirt.engine.api.common.util.QueryHelper.hasMatrixParam ( getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumeResource.NFS_CONSTRAINT_PARAMETER ) ) ) { java.util.HashMap < java.lang.String , java.lang.String > matrixConstraints = org.ovirt.engine.api.common.util.QueryHelper.getMatrixConstraints ( getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumeResource.NFS_CONSTRAINT_PARAMETER ) ; java.lang.String maxString = matrixConstraints.get ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumeResource.NFS_CONSTRAINT_PARAMETER ) ; return java.lang.Boolean.valueOf ( maxString ) ; } else { return false ; } }

Target:
private java.lang.Boolean isNfsStatistics ( ) { return org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumeResource.NFS_CONSTRAINT_PARAMETER , true , false ) ; }
Source:
public void testValidModifiedBondsWhenAllOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setName ( "bond0" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , null , true , true ) ; }

Target:
public void testValidModifiedBondsWhenAllOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond1" ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID , ValidationResult.VALID ) ; }
Source:
public void compensate ( ) { revertTask ( ) ; org.ovirt.engine.core.common.vdscommands.VDSCommandType revertCommandType = getRevertVDSCommandType ( ) ; if ( revertCommandType != null ) { addTask ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getRevertVDSCommandType ( ) , getRevertVDSParameters ( ) ) , true ) ; } }

Target:
public void compensate ( ) { revertTask ( ) ; org.ovirt.engine.core.common.vdscommands.VDSCommandType revertCommandType = getRevertVDSCommandType ( ) ; if ( revertCommandType != null ) { addTask ( Guid.Empty , org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( getRevertVDSCommandType ( ) , getRevertVDSParameters ( ) ) , true ) ; } }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter parameter = new org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter ( ) ; parameter.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; parameter.setName ( "IP" ) ; parameter.setValue ( "192.168.122.2" ) ; parameter.setVmInterfaceId ( FixturesTool.VM_NETWORK_INTERFACE ) ; org.junit.Assert.assertNull ( dao.get ( parameter.getId ( ) ) ) ; dao.save ( parameter ) ; org.junit.Assert.assertEquals ( parameter , dao.get ( parameter.getId ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter parameter = new org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter ( ) ; parameter.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; parameter.setName ( "IP" ) ; parameter.setValue ( "192.168.122.2" ) ; parameter.setVmInterfaceId ( FixturesTool.VM_NETWORK_INTERFACE ) ; return parameter ; }
Source:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity , uriInfo ) ; } parent.setPayload ( model ) ; parent.setBallooning ( model ) ; parent.setCertificateInfo ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity , uriInfo ) ; } parent.setPayload ( model ) ; parent.setCertificateInfo ( model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; return model ; }