auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel > ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }

Target:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel > ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }
Source:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.Label label = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( org.ovirt.engine.core.bll.AddLabelCommand.getParameters ( ) . getLabel ( ) ) . build ( ) ; labelDao.save ( label ) ; org.ovirt.engine.core.bll.AddLabelCommand.setSucceeded ( true ) ; setActionReturnValue ( label.getId ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.Label label = new org.ovirt.engine.core.common.businessentities.LabelBuilder ( org.ovirt.engine.core.bll.AddLabelCommand.getParameters ( ) . getLabel ( ) ) . build ( ) ; labelDao.save ( label ) ; vmStaticDao.incrementDbGenerationForVms ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( label.getVms ( ) ) ) ; org.ovirt.engine.core.bll.AddLabelCommand.setSucceeded ( true ) ; setActionReturnValue ( label.getId ( ) ) ; }
Source:
public void testAllDomainsExistAndActiveOneInactive ( ) { domain1.setStatus ( StorageDomainStatus.Active ) ; domain2.setStatus ( StorageDomainStatus.InActive ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( "One domain should not be active" , result.isValid ( ) ) ; org.junit.Assert.assertEquals ( "Wrong validation error" , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , result.getMessage ( ) ) ; }

Target:
public void testAllDomainsExistAndActiveOneInactive ( ) { domain1.setStatus ( StorageDomainStatus.Active ) ; domain2.setStatus ( StorageDomainStatus.Inactive ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( "One domain should not be active" , result.isValid ( ) ) ; org.junit.Assert.assertEquals ( "Wrong validation error" , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 , result.getMessage ( ) ) ; }
Source:
public void validateSucceedsWithStopActionType ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStopActionTypeAndClusterId ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd.getParameters ( ) . setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.setClusterId ( cmd.getParameters ( ) . getClusterId ( ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.event_subscriber before = dao.getAllForSubscriber ( existingSubscriber ) . get ( 0 ) ; int oldMethodId = before.getmethod_id ( ) ; before.setmethod_id ( 2 ) ; dao.update ( before , oldMethodId ) ; org.ovirt.engine.core.common.businessentities.event_subscriber after = dao.getAllForSubscriber ( existingSubscriber ) . get ( 0 ) ; assertNotNull ( after ) ; assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.event_subscriber before = dao.getAllForSubscriber ( existingSubscriber ) . get ( 0 ) ; int oldMethodId = before.getmethod_id ( ) ; before.setmethod_id ( 2 ) ; dao.update ( before , oldMethodId ) ; org.ovirt.engine.core.common.businessentities.event_subscriber after = dao.getAllForSubscriber ( existingSubscriber ) . get ( 0 ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
public org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clone ( ) throws java.lang.CloneNotSupportedException { return new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompClientPolicy ( this . getRetryTimeOut ( ) , this . getRetryNumber ( ) , this . getIncomingHeartbeat ( ) , this . getOutgoingHeartbeat ( ) , this . getExceptions ( ) , this . requestQueue , this . responseQueue ) ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clone ( ) throws java.lang.CloneNotSupportedException { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompClientPolicy policy = new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompClientPolicy ( this . getRetryTimeOut ( ) , this . getRetryNumber ( ) , this . getIncomingHeartbeat ( ) , this . getOutgoingHeartbeat ( ) , this . getExceptions ( ) , this . requestQueue , this . responseQueue ) ; policy.setEventQueue ( this . eventQueue ) ; return policy ; }
Source:
protected boolean isVmNameValidLength ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String vmName = vm.getvm_name ( ) ; int maxVmNameLengthWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxVmNameLengthWindows ) ; int maxVmNameLengthNonWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxVmNameLengthNonWindows ) ; int maxLength = ( vm.getvm_os ( ) . isWindows ( ) ) ? maxVmNameLengthWindows : maxVmNameLengthNonWindows ; boolean nameLengthValid = ( vmName.length ( ) ) <= maxLength ; return nameLengthValid ; }

Target:
protected boolean isVmNameValidLength ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String vmName = vm.getVmName ( ) ; int maxVmNameLengthWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxVmNameLengthWindows ) ; int maxVmNameLengthNonWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxVmNameLengthNonWindows ) ; int maxLength = ( vm.getVmOs ( ) . isWindows ( ) ) ? maxVmNameLengthWindows : maxVmNameLengthNonWindows ; boolean nameLengthValid = ( vmName.length ( ) ) <= maxLength ; return nameLengthValid ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateFloppy ( ) { if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( runVmParam.getFloppyPath ( ) ) ) && ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isFloppySupported ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_FLOPPY_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateFloppy ( ) { if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( runVmParam.getFloppyPath ( ) ) ) && ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isFloppySupported ( vm.getOs ( ) , vm.getClusterCompatibilityVersion ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_FLOPPY_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DbUser user ) { if ( user.getLastAdminCheckStatus ( ) ) { return getApplicationResources ( ) . adminImage ( ) ; } if ( user.getIsGroup ( ) ) { return getApplicationResources ( ) . userGroupImage ( ) ; } return getApplicationResources ( ) . userImage ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.DbUser user ) { if ( user.getLastAdminCheckStatus ( ) ) { return getApplicationResources ( ) . adminImage ( ) ; } if ( user.isGroup ( ) ) { return getApplicationResources ( ) . userGroupImage ( ) ; } return getApplicationResources ( ) . userImage ( ) ; }
Source:
public void testRemove ( ) 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 } , getEntity ( 0 ) ) ; setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.NETWORK_ID } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void testInterfaceInHostWhenInDifferentHost ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceInHost ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NIC_NOT_EXISTS_ON_HOST ) ) ; }

Target:
public void testInterfaceInHostWhenInDifferentHost ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NIC_NOT_EXISTS_ON_HOST , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NIC_NOT_EXISTS_ON_HOST_ENTITY , hostId.toString ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceInHost ( hostId ) , matcher ) ; }
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 testUpdateWithNonExistingNetwork ( ) throws java.lang.Exception { control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( true ) ) ; nic.getNetwork ( ) . setId ( GUIDS [ 2 ] . toString ( ) ) ; assertNotNull ( nic ) ; }
Source:
public static void GetSANWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ( ( ( java.util.List ) ( source ) ) . size ( ) ) > 0 ) ) { return true ; } return false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
protected void executeCommand ( ) { getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getProviderDao ( ) . save ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getProviderDao ( ) . save ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String value ) { transitionHandler.handlePlaceTransition ( true ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String value ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; parameters.put ( FragmentParams.NAME.getName ( ) , vm.getName ( ) ) ; getPlaceTransitionHandler ( ) . handlePlaceTransition ( WebAdminApplicationPlaces.virtualMachineGeneralSubTabPlace , parameters ) ; }
Source:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetExternalSubnetsOnProviderByExternalNetwork , org.ovirt.engine.core.common.queries.GetExternalSubnetsOnProviderByExternalNetworkQueryParameters.class , new java.lang.String [ ] { "ProviderId" , "NetworkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ 1 ] ) } , ( notFound ? null : getSubnets ( ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetExternalSubnetsOnProviderByExternalNetwork , org.ovirt.engine.core.common.queries.GetExternalSubnetsOnProviderByExternalNetworkQueryParameters.class , new java.lang.String [ ] { "ProviderId" , "NetworkId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ 1 ] ) } , ( notFound ? null : getSubnets ( ) ) ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network createNetworkWithNameAndLabel ( java.lang.String name , java.lang.String label ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithName ( name ) ; network.setLabel ( label ) ; return network ; }
Source:
private com.google.gwt.user.client.ui.PushButton createButton ( com.google.gwt.resources.client.ImageResource imageResource ) { com.google.gwt.user.client.ui.PushButton result = new com.google.gwt.user.client.ui.PushButton ( new com.google.gwt.user.client.ui.Image ( imageResource ) , new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { toggleVisibleWestPanel ( ) ; } } ) ; result.setVisible ( false ) ; result.addStyleName ( style.sliderButton ( ) ) ; return result ; }

Target:
private com.google.gwt.user.client.ui.PushButton createButton ( com.google.gwt.resources.client.ImageResource imageResource ) { com.google.gwt.user.client.ui.PushButton result = new com.google.gwt.user.client.ui.PushButton ( new com.google.gwt.user.client.ui.Image ( imageResource ) , new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { toggleVisibleWestPanel ( ) ; } } ) ; result.setVisible ( false ) ; result.addStyleName ( style.sliderButton ( ) ) ; result.addStyleName ( "tslp_sliderButton_pfly_fix" ) ; return result ; }
Source:
public java.lang.Boolean call ( ) throws java.lang.Exception { _goingToReboot = ( ( java.lang.Boolean ) ( _parser.cliEnvironmentGet ( SysEnv.REBOOT ) ) ) ; if ( _goingToReboot ) { userVisibleLog ( java.util.logging.Level.INFO , "Reboot scheduled" ) ; } return true ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { if ( ( _resultError ) || ( ! ( _installIncomplete ) ) ) { _parser.cliNoop ( ) ; } else { java.lang.String [ ] msgs = ( ( java.lang.String [ ] ) ( _parser.cliEnvironmentGet ( org.ovirt.ovirt_host_deploy.constants.CoreEnv.INSTALL_INCOMPLETE_REASONS ) ) ) ; userVisibleLog ( java.util.logging.Level.WARNING , "Installation is incomplete, manual intervention is required" ) ; for ( java.lang.String m : msgs ) { userVisibleLog ( java.util.logging.Level.WARNING , m ) ; } } return true ; }
Source:
protected org.ovirt.engine.api.model.Network lookupClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.util.List < org.ovirt.engine.api.model.Network > networks ) { for ( org.ovirt.engine.api.model.Network network : networks ) { if ( ( ( id != null ) && ( id.equals ( network.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( network.getName ( ) ) ) ) ) { return network ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.Network lookupClusterNetwork ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.util.List < org.ovirt.engine.api.restapi.resource.Network > networks ) { for ( org.ovirt.engine.api.restapi.resource.Network network : networks ) { if ( ( ( id != null ) && ( id.equals ( network.getId ( ) ) ) ) || ( ( name != null ) && ( name.equals ( network.getName ( ) ) ) ) ) { return network ; } } return null ; }
Source:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTaskFromDb ( org.ovirt.engine.core.compat.Guid asyncTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( asyncTask != null ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallBackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallBackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }
Source:
public 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 ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc shutdownHost ( int reboot ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.shutdownHost ( reboot ) ; 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 glusterHookDisable ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookDisable ( glusterCommand , stage , hookName ) ; 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 ) ; } }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue ExecuteVerb ( ) { org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters tempVar = new org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; tempVar.setStorageDomainId ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) ) ; tempVar.setVmIdList ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getIds ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetVmsInfo , tempVar ) ; return retVal ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( ) { org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters tempVar = new org.ovirt.engine.core.common.vdscommands.GetVmsInfoVDSCommandParameters ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; tempVar.setStorageDomainId ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) ) ; tempVar.setVmIdList ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getIds ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetVmsInfo , tempVar ) ; return retVal ; }
Source:
public void testListFailure ( ) { setUpMacPoolsQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }

Target:
public void testListFailure ( ) { setUpMacPoolsQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.lang.String mode = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdcOptionDao ( ) . getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getoption_value ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( VdcBllMessages.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.lang.String mode = dbFacade.getVdcOptionDao ( ) . getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getoption_value ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( EngineMessage.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }
Source:
protected void addJNDIBeans ( ) { addBeanJNDIName ( BeanType.BACKEND , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/Backend" ) ) ; addBeanJNDIName ( BeanType.SCHEDULER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-scheduler/Scheduler" ) ) ; addBeanJNDIName ( BeanType.USERS_DOMAINS_CACHE , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/UsersDomainsCacheManagerService" ) ) ; addBeanJNDIName ( BeanType.VDS_EVENT_LISTENER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/VdsEventListener" ) ) ; addBeanJNDIName ( BeanType.LOCK_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/LockManager" ) ) ; }

Target:
protected void addJNDIBeans ( ) { addBeanJNDIName ( BeanType.BACKEND , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/Backend" ) ) ; addBeanJNDIName ( BeanType.SCHEDULER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-scheduler/Scheduler" ) ) ; addBeanJNDIName ( BeanType.USERS_DOMAINS_CACHE , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/UsersDomainsCacheManagerService" ) ) ; addBeanJNDIName ( BeanType.VDS_EVENT_LISTENER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/VdsEventListener" ) ) ; addBeanJNDIName ( BeanType.LOCK_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/LockManager" ) ) ; addBeanJNDIName ( BeanType.EVENTQUEUE_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "engine-bll/EventQueue" ) ) ; }
Source:
public static void removeVmStatelessImages ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.bll.context.CommandContext context ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vmId , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.VmPoolHandler.log.infoFormat ( "VdcBll.VmPoolHandler.processVmPoolOnStopVm - Deleting snapshot for stateless vm {0}" , vmId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) , context ) ; } }

Target:
public static void removeVmStatelessImages ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.bll.context.CommandContext context ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vmId , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , vmId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vmId ) , context ) ; } }
Source:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getMaxVmsInPool ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1000 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVmsInPool , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
void initEditors ( ) { versionEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxOnlyEditor < java.lang.Object > ( new com.google.gwt.text.shared.AbstractRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String render ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( object ) ) ; return model.getTitle ( ) ; } } ) ; }

Target:
void initEditors ( ) { versionEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxOnlyEditor < java.lang.Object > ( new com.google.gwt.text.shared.AbstractRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String render ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( object ) ) ; return model.getTitle ( ) ; } } ) ; overrideEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { java.lang.String authzName = null ; if ( ( getProfile ( sessionId ) ) != null ) { authzName = getProfile ( sessionId ) . getAuthzName ( ) ; } org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , authzName , getPrincipalName ( sessionId ) , message , msgArgs ) ; engineSessionDao.remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { if ( ssoSessionUtils.isSessionInUse ( getEngineSessionSeqId ( sessionId ) ) ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = getUser ( sessionId , false ) ; log.info ( "Not removing session '{}', session has running commands{}" , sessionId , ( dbUser == null ? "." : java.lang.String.format ( " for user '%s@%s'." , dbUser.getLoginName ( ) , dbUser.getDomain ( ) ) ) ) ; return ; } java.lang.String authzName = null ; if ( ( getProfile ( sessionId ) ) != null ) { authzName = getProfile ( sessionId ) . getAuthzName ( ) ; } org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , authzName , getPrincipalName ( sessionId ) , message , msgArgs ) ; engineSessionDao.remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
public void doTestBadAddFromConfigurationMissingParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setInitialization ( new org.ovirt.engine.api.model.Initialization ( ) ) ; model.getInitialization ( ) . setConfiguration ( new org.ovirt.engine.api.model.Configuration ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "initialization.configuration.type" , "initialization.configuration.data" ) ; } }

Target:
public void doTestBadAddFromConfigurationMissingParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setInitialization ( new org.ovirt.engine.api.model.Initialization ( ) ) ; model.getInitialization ( ) . setConfiguration ( new org.ovirt.engine.api.model.Configuration ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "initialization.configuration.type" , "initialization.configuration.data" ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.scheduling.PolicyUnit object ) { if ( object.isInternal ( ) ) { setTitle ( constants.internalPolicyUnit ( ) ) ; return resources.lockImage ( ) ; } setTitle ( constants.externalPolicyUnit ( ) ) ; return resources.exteranlPolicyUnitImage ( ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.scheduling.PolicyUnit object ) { java.lang.String tooltipContent = null ; if ( object.isInternal ( ) ) { tooltipContent = org.ovirt.engine.ui.webadmin.section.main.view.popup.scheduling.ManagePolicyUnitPopupView.constants.internalPolicyUnit ( ) ; } else { tooltipContent = org.ovirt.engine.ui.webadmin.section.main.view.popup.scheduling.ManagePolicyUnitPopupView.constants.externalPolicyUnit ( ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( tooltipContent ) ; }
Source:
public void testGetEntityNameByIdAndTypeForVmPool ( ) { org.ovirt.engine.core.common.businessentities.vm_pools vmPool = dbFacade.getVmPoolDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_POOL_ID ) ; org.junit.Assert.assertNotNull ( vmPool ) ; java.lang.String name = vmPool.getvm_pool_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_POOL_ID , VdcObjectType.VmPool ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVmPool ( ) { org.ovirt.engine.core.common.businessentities.VmPool vmPool = dbFacade.getVmPoolDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_POOL_ID ) ; org.junit.Assert.assertNotNull ( vmPool ) ; java.lang.String name = vmPool.getVmPoolName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_POOL_ID , VdcObjectType.VmPool ) ) ) ; }
Source:
public void testGetGlusterVolumeSnapshotConfigByVolumeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = dao.getConfigByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID ) ; org.junit.Assert.assertTrue ( ( configs != null ) ) ; org.junit.Assert.assertTrue ( ( ( configs.size ( ) ) == 2 ) ) ; org.junit.Assert.assertTrue ( configs.contains ( existingConfig1 ) ) ; }

Target:
public void testGetGlusterVolumeSnapshotConfigByVolumeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig > configs = dao.getConfigByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID ) ; org.junit.Assert.assertNotNull ( configs ) ; org.junit.Assert.assertEquals ( 2 , configs.size ( ) ) ; org.junit.Assert.assertTrue ( configs.contains ( existingConfig1 ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getParameters ( ) . isNeedsLocking ( ) ? java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) . toString ( ) , LockMessagesMatchUtil.VM ) : null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getParameters ( ) . isNeedsLocking ( ) ? java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) : null ; }
Source:
private boolean interfaceOrItsVlanDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > removedNetworkAttachmentsByNicName , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface potentialSlave ) { boolean validSlave = interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsByNicName , potentialSlave ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlanInterfacesForInterface = vlanInterfacesForInterface ( potentialSlave ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface : vlanInterfacesForInterface ) { validSlave = validSlave && ( interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsByNicName , vdsNetworkInterface ) ) ; } return validSlave ; }

Target:
org.ovirt.engine.core.bll.ValidationResult validateSlaveHasNoLabels ( java.lang.String slaveName ) { java.util.Set < java.lang.String > labelsToConfigureOnNic = getLabelsToConfigureOnNic ( slaveName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.LABEL_ATTACH_TO_IMPROPER_INTERFACE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "LABEL_ATTACH_TO_IMPROPER_INTERFACE_ENTITY" , slaveName ) ) . unless ( ( ( labelsToConfigureOnNic == null ) || ( labelsToConfigureOnNic.isEmpty ( ) ) ) ) ; }
Source:
private boolean shouldUpdateImageProperties ( ) { return ( ( getOldDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ! ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) . equals ( getQuotaId ( ) ) ) ) ; }

Target:
private boolean shouldUpdateImageProperties ( ) { if ( ( getOldDisk ( ) . getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( oldQuotaId , getQuotaId ( ) ) ) ; }
Source:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getName ( ) , getStoragePool ( ) . getName ( ) , e ) ; } }

Target:
public void execute ( int iterationId ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdss ( ) . get ( iterationId ) ; try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , vds.getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage domain (name: {1}, id: {2}). Exception: {3}" , vds.getName ( ) , getStorageDomain ( ) . getName ( ) , getStorageDomain ( ) . getId ( ) , e ) ; } }
Source:
public void testGetBrandingThemes ( ) { java.util.List < org.ovirt.engine.core.branding.BrandingTheme > result = testManager.getBrandingThemes ( ) ; org.junit.Assert.assertNotNull ( "There should be a result" , result ) ; org.junit.Assert.assertEquals ( "There should be five active themes" , 5 , result.size ( ) ) ; java.util.List < org.ovirt.engine.core.branding.BrandingTheme > result2 = testManager.getBrandingThemes ( ) ; org.junit.Assert.assertNotNull ( "There should be a result" , result2 ) ; org.junit.Assert.assertEquals ( "There should be five active themes" , 5 , result2.size ( ) ) ; org.junit.Assert.assertTrue ( "The result are not the same object" , ( result == result2 ) ) ; }

Target:
public void testGetBrandingThemes ( ) { java.util.List < org.ovirt.engine.core.branding.BrandingTheme > result = testManager.getBrandingThemes ( ) ; org.junit.Assert.assertNotNull ( "There should be a result" , result ) ; org.junit.Assert.assertEquals ( "There should be five active themes" , 5 , result.size ( ) ) ; java.util.List < org.ovirt.engine.core.branding.BrandingTheme > result2 = testManager.getBrandingThemes ( ) ; org.junit.Assert.assertNotNull ( "There should be a result" , result2 ) ; org.junit.Assert.assertEquals ( "There should be five active themes" , 5 , result2.size ( ) ) ; org.junit.Assert.assertSame ( "The result are not the same object" , result , result2 ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; return performAction ( VdcActionType.RemoveNetwork , new org.ovirt.engine.core.common.action.RemoveNetworkParameters ( guid ) ) ; }

Target:
private org.ovirt.engine.api.model.Network getNetwork ( ) { java.util.List < org.ovirt.engine.api.model.Network > networks = parent.getNetworks ( ) ; for ( org.ovirt.engine.api.model.Network entity : networks ) { if ( entity.getId ( ) . toString ( ) . equals ( id ) ) { return entity ; } } return null ; }