auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }

Target:
public void getClusterFeaturesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String snapshotName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.volumeSnapshotDelete" ) . withOptionalParameter ( "snapName" , snapshotName ) . 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 glusterSnapshotDelete ( java.lang.String snapshotName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.delete" ) . withOptionalParameter ( "snapName" , snapshotName ) . 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:
private void executeQueryCommandChecked ( ) throws java.io.IOException { final org.ovirt.engine.core.common.businessentities.GraphicsInfo graphicsInfo = getGraphicsInfo ( ) ; final java.util.Map < java.lang.String , java.lang.Object > ticketModel = createTicket ( graphicsInfo ) ; final java.lang.String jsonTicket = new org.codehaus.jackson.map.ObjectMapper ( ) . writeValueAsString ( ticketModel ) ; final java.lang.String encodedTicket = java.net.URLEncoder.encode ( jsonTicket , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; final java.lang.String signedTicket = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( QueryType.SignString , new org.ovirt.engine.core.common.queries.SignStringParameters ( encodedTicket ) ) . getReturnValue ( ) ; org.ovirt.engine.core.bll.GetSignedWebsocketProxyTicketQuery.setReturnValue ( signedTicket ) ; }

Target:
private void executeQueryCommandChecked ( ) throws java.io.IOException { final org.ovirt.engine.core.common.businessentities.GraphicsInfo graphicsInfo = getGraphicsInfo ( ) ; final java.util.Map < java.lang.String , java.lang.Object > ticketModel = createTicket ( graphicsInfo ) ; final java.lang.String jsonTicket = new org.codehaus.jackson.map.ObjectMapper ( ) . writeValueAsString ( ticketModel ) ; final java.lang.String encodedTicket = java.net.URLEncoder.encode ( jsonTicket , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; final java.lang.String signedTicket = backend.runInternalQuery ( QueryType.SignString , new org.ovirt.engine.core.common.queries.SignStringParameters ( encodedTicket ) ) . getReturnValue ( ) ; org.ovirt.engine.core.bll.GetSignedWebsocketProxyTicketQuery.setReturnValue ( signedTicket ) ; }
Source:
private static void addBootProtocol ( java.util.Map < java.lang.String , java.lang.Object > entry , org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.vdsbroker.vdsbroker.BootProtocolResolver resolver = ( org.ovirt.engine.core.common.FeatureSupported.cfgEntriesDeprecated ( host.getVdsGroupCompatibilityVersion ( ) ) ) ? new org.ovirt.engine.core.vdsbroker.vdsbroker.NoCfgBootProtocolResolver ( entry , iface , host ) : new org.ovirt.engine.core.vdsbroker.vdsbroker.CfgBootProtocolResolver ( entry , iface , host ) ; resolver.resolve ( ) ; }

Target:
private static void addBootProtocol ( java.util.Map < java.lang.String , java.lang.Object > entry , org.ovirt.engine.core.common.businessentities.VDS host , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { org.ovirt.engine.core.vdsbroker.vdsbroker.BootProtocolResolver resolver = ( org.ovirt.engine.core.common.FeatureSupported.cfgEntriesDeprecated ( host.getClusterCompatibilityVersion ( ) ) ) ? new org.ovirt.engine.core.vdsbroker.vdsbroker.NoCfgBootProtocolResolver ( entry , iface , host ) : new org.ovirt.engine.core.vdsbroker.vdsbroker.CfgBootProtocolResolver ( entry , iface , host ) ; resolver.resolve ( ) ; }
Source:
private void RunVMOnSpecificHost_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getRunVMOnSpecificHost ( ) . getEntity ( ) ) ) == true ) { clearAndDisable ( getDontMigrateVM ( ) ) ; getHostCpu ( ) . setIsChangable ( true ) ; } else { clearAndDisable ( getHostCpu ( ) ) ; getDontMigrateVM ( ) . setIsChangable ( true ) ; } behavior.updateCpuPinningVisibility ( ) ; }

Target:
private void initMigrationMode ( ) { getMigrationMode ( ) . setItems ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.MigrationSupport.values ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.GraphicsDevice getGraphicsDevOfType ( org.ovirt.engine.core.common.businessentities.GraphicsType type ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue query = org.ovirt.engine.core.bll.UpdateVmCommand.getBackend ( ) . runInternalQuery ( VdcQueryType.GetGraphicsDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmId ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = query.getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice dev : graphicsDevices ) { if ( ( dev.getVmDeviceType ( ) ) == ( type.getCorrespondingDeviceType ( ) ) ) { return dev ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.GraphicsDevice getGraphicsDevOfType ( org.ovirt.engine.core.common.businessentities.GraphicsType type ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = getGraphicsDevices ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice dev : graphicsDevices ) { if ( ( dev.getGraphicsType ( ) ) == type ) { return dev ; } } return null ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDiskForVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateMetaDataDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_META_DATA_DISK_DESCRIPTION ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Sparse ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Sparse ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }
Source:
public static void main ( java.lang.String ... args ) { try { org.ovirt.engine.core.config.EngineConfig.getInstance ( ) . setParser ( new org.ovirt.engine.core.config.EngineConfigCLIParser ( ) ) ; org.ovirt.engine.core.config.EngineConfig.getInstance ( ) . setUpAndExecute ( args ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.config.EngineConfig.log.debug ( "Exiting with error: " , t ) ; org.ovirt.engine.core.config.EngineConfig.console.writeErrorLine ( t.getMessage ( ) ) ; java.lang.System.exit ( 1 ) ; } }

Target:
public static void main ( java.lang.String ... args ) { org.ovirt.engine.core.config.EngineConfig.initLogging ( ) ; try { org.ovirt.engine.core.config.EngineConfig.getInstance ( ) . setParser ( new org.ovirt.engine.core.config.EngineConfigCLIParser ( ) ) ; org.ovirt.engine.core.config.EngineConfig.getInstance ( ) . setUpAndExecute ( args ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.config.EngineConfig.log.debug ( "Exiting with error: " , t ) ; org.ovirt.engine.core.config.EngineConfig.console.writeErrorLine ( t.getMessage ( ) ) ; java.lang.System.exit ( 1 ) ; } }
Source:
public void getIpv6AddressOfNetwork ( ) { nic.setIpv6Address ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.IPV6_ADDRESS ) ; org.junit.Assert.assertThat ( underTest.getIpv6AddressOfNetwork ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NETWORK_NAME1 ) , org.hamcrest.Matchers.is ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.IPV6_ADDRESS ) ) ; }

Target:
public void setUp ( ) { injectorRule.bind ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class , mockManagementNetworkUtil ) ; managementNetwork.setId ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.MANAGEMENT_NETWORK_ID ) ; org.mockito.Mockito.when ( mockManagementNetworkUtil.getManagementNetwork ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.CLUSTER_ID ) ) . thenReturn ( managementNetwork ) ; nic.setNetworkName ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NETWORK_NAME1 ) ; nic.setName ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NIC_NAME ) ; host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setClusterId ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.CLUSTER_ID ) ; host.setClusterCompatibilityVersion ( Version.v4_0 ) ; host.getInterfaces ( ) . add ( nic ) ; underTest = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( host , org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.COMMAND_CONTEXT ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelper.getInstance ( ) . createStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( storageConnectionHelper.createStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , 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 getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.EngineWorkingMode mode = org.ovirt.engine.core.common.config.Config.< org.ovirt.engine.core.common.EngineWorkingMode > GetValue ( ConfigValues.EngineMode ) ; switch ( mode ) { case MAINTENANCE : return getErrorCommandReturnValue ( VdcBllMessages.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; case PREPARE : 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 = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdcOptionDao ( ) . getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , Config.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 ; }
Source:
protected boolean showTooltip ( com.google.gwt.dom.client.Element parent , java.lang.String value ) { com.google.gwt.safehtml.shared.SafeHtml escapedValue = getEscapedValue ( value ) ; com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( escapedValue ) ; return ( super . showTooltip ( parent , value ) ) || ( ! ( escapedValue.equals ( renderedValue ) ) ) ; }

Target:
protected boolean showTooltip ( com.google.gwt.dom.client.Element parent , java.lang.String value ) { if ( ( title ) != null ) { return true ; } com.google.gwt.safehtml.shared.SafeHtml escapedValue = getEscapedValue ( value ) ; com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( escapedValue ) ; return ( super . showTooltip ( parent , value ) ) || ( ! ( escapedValue.equals ( renderedValue ) ) ) ; }
Source:
public void unlabel ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel labelModel ) { labelModel.setInterface ( null ) ; getLabels ( ) . remove ( labelModel ) ; java.util.Set < java.lang.String > labels = getIface ( ) . getLabels ( ) ; labels.remove ( labelModel.getName ( ) ) ; if ( labels.isEmpty ( ) ) { getIface ( ) . setLabels ( null ) ; } }

Target:
public java.lang.String getName ( ) { return getOriginalIface ( ) . getName ( ) ; }
Source:
public void PostOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue , boolean approveInitiated ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { if ( approveInitiated ) { OnApproveInternal ( ) ; } Cancel ( ) ; } }

Target:
public void postOnSaveInternal ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue , boolean approveInitiated ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { if ( approveInitiated ) { onApproveInternal ( ) ; } cancel ( ) ; } }
Source:
private static java.lang.String useDefaultIfNull ( java.lang.String key , java.lang.String value , java.lang.String defaultValue , boolean printDefaultValue ) { if ( ( value == null ) && printDefaultValue ) { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.errorFormat ( "Could not find value for {0}. Going to use default value of: {1}" , key , defaultValue ) ; } return value != null ? value : defaultValue ; }

Target:
private static java.lang.String useDefaultIfNull ( java.lang.String key , java.lang.String value , java.lang.String defaultValue , boolean printDefaultValue ) { if ( ( value == null ) && printDefaultValue ) { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.warnFormat ( "Could not find value for key '{0}'. Going to use default value of: '{1}'" , key , defaultValue ) ; } return value != null ? value : defaultValue ; }
Source:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }

Target:
public void testIscsiLunCanBeAddedIfScsiPassthroughEnabledAndScsiReservationEnabled ( ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = createISCSILunDisk ( ScsiGenericIO.UNFILTERED , true , DiskInterface.IDE ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; mockVm ( ) ; mockInterfaceList ( ) ; org.junit.Assert.assertTrue ( "Failed to add Lun disk when scsi passthrough and scsi reservation are enabled" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; }
Source:
public void updateCpuSharesAmountChangeability ( ) { boolean changeable = ( getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) ) == ( UnitVmModel.CpuSharesAmount.CUSTOM ) ; boolean none = ( getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) ) == ( UnitVmModel.CpuSharesAmount.DISABLED ) ; getModel ( ) . getCpuSharesAmount ( ) . setEntity ( ( changeable || none ? null : getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) . getValue ( ) ) ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsChangable ( changeable ) ; }

Target:
public void updateCpuSharesAmountChangeability ( ) { boolean changeable = ( getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) ) == ( UnitVmModel.CpuSharesAmount.CUSTOM ) ; boolean none = ( getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) ) == ( UnitVmModel.CpuSharesAmount.DISABLED ) ; getModel ( ) . getCpuSharesAmount ( ) . setEntity ( ( changeable || none ? null : getModel ( ) . getCpuSharesAmountSelection ( ) . getSelectedItem ( ) . getValue ( ) ) ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsChangeable ( changeable ) ; }
Source:
public void testAddIncompleteParameters_noName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }

Target:
public void testAddIncompleteParametersNoName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Network" , "add" , "id|name" ) ; } }
Source:
public void deleteJobOlderThanDateWithStatus ( java.util.Date sinceDate , java.util.List < org.ovirt.engine.core.common.job.JobExecutionStatus > statusesList ) { updateQuery ( getEntityManager ( ) . createNamedQuery ( "Job.deleteJobOlderThanDateWithStatus" ) . setParameter ( "sinceDate" , sinceDate ) . setParameter ( "statuses" , statusesList ) ) ; }

Target:
public void deleteJobOlderThanDateWithStatus ( java.util.Date sinceDate , java.util.List < org.ovirt.engine.core.common.job.JobExecutionStatus > statusesList ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "end_time" , sinceDate ) . addValue ( "status" , org.apache.commons.lang.StringUtils.join ( statusesList , "," ) ) ; getCallsHandler ( ) . executeModification ( "DeleteJobOlderThanDateWithStatus" , parameterSource ) ; }
Source:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAO2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAO2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO2 ) . when ( cmd ) . getStoragePoolDAO ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void versionDecreaseNoHostsOrNetwork ( ) { createCommandWithOlderVersion ( ) ; setupCpu ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFS ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
Source:
public void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }

Target:
public void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > > aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged , boolean hostDev ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null , false ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addInterface ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , boolean plugged , boolean hostDev , java.lang.String address ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , plugged , false , address , null , false ) ; }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity newHook = getGlusterHook ( ) ; newHook.setId ( FixturesTool.NEW_HOOK_ID ) ; dao.save ( newHook ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( newHook.getId ( ) ) ; org.junit.Assert.assertEquals ( newHook , hook ) ; }

Target:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity newHook = getGlusterHook ( ) ; newHook.setId ( FixturesTool.NEW_HOOK_ID ) ; dao.save ( newHook ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = dao.getById ( newHook.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( newHook , hook ) ; }
Source:
public void setErrorMessages ( java.util.List < com.google.gwt.safehtml.shared.SafeHtml > messages ) { clearErrorMessages ( ) ; for ( com.google.gwt.safehtml.shared.SafeHtml message : messages ) { org.gwtbootstrap3.client.ui.Label messageLabel = new org.gwtbootstrap3.client.ui.Label ( ) ; messageLabel.setHTML ( message.asString ( ) ) ; messageLabel.addStyleName ( style.loginMessageError ( ) ) ; errorMessagePanel.add ( messageLabel ) ; errorMessagePanel.setVisible ( true ) ; } }

Target:
public void setErrorMessages ( java.util.List < com.google.gwt.safehtml.shared.SafeHtml > messages ) { errorMessagePanel.setMessages ( messages , style.loginMessageError ( ) , style.labelDefault ( ) , style.informationMessage ( ) , PatternflyConstants.TEMP_LINK_COLOR ) ; errorMessagePanel.setVisible ( true ) ; }
Source:
public void shouldDetectMissingPinningEntry ( ) { vm.getvNumaNodeList ( ) . get ( 0 ) . getVdsNumaNodeList ( ) . get ( 0 ) . getSecond ( ) . setSecond ( null ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PINNED_INDEX_ERROR ) ; }

Target:
public void shouldDetectMissingPinningEntry ( ) { vm.getvNumaNodeList ( ) . get ( 0 ) . getVdsNumaNodeList ( ) . set ( 0 , null ) ; assertValidationFailure ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_PINNED_INDEX_ERROR ) ; }
Source:
public void rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }

Target:
public void rollback ( ) { log.error ( "Transaction rolled-back for command '{}'." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }
Source:
private void removeStatlessSnapshot ( ) { runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , true ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }

Target:
private void removeStatlessSnapshot ( ) { runInternalAction ( ActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , true ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ) ; org.ovirt.engine.core.bll.RunVmCommand.setLock ( null ) ; org.ovirt.engine.core.bll.RunVmCommand.setSucceeded ( true ) ; }
Source:
public void testCdRomLinks ( ) { org.ovirt.engine.api.model.Cdrom cdrom = new org.ovirt.engine.api.model.Cdrom ( ) ; cdrom.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CDROM_ID ) ; cdrom.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; cdrom.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( cdrom ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CDROM_HREF , cdrom.getHref ( ) ) ; }

Target:
public void testCdRomLinks ( ) { org.ovirt.engine.api.model.Cdrom cdrom = new org.ovirt.engine.api.model.Cdrom ( ) ; cdrom.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CDROM_ID ) ; cdrom.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; cdrom.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( cdrom ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.CDROM_HREF , cdrom.getHref ( ) ) ; }
Source:
public void validatePass ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; int i = new java.util.Random ( ) . nextInt ( SUPPORTED_DOMAIN_TYPES.length ) ; sd.setStorageType ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES [ i ] ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validatePass ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; int i = new java.util.Random ( ) . nextInt ( SUPPORTED_DOMAIN_TYPES.length ) ; sd.setStorageType ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES [ i ] ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.validate ( ) ) ; }
Source:
public static org.ovirt.engine.api.model.RSDL loadRsdl ( org.ovirt.engine.core.common.mode.ApplicationMode applicationMode ) throws java.io.IOException { java.lang.String fileName = ( applicationMode == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) ? "/" + ( RsdlIOManager.GLUSTER_RSDL_RESOURCE_NAME ) : "/" + ( RsdlIOManager.RSDL_RESOURCE_NAME ) ; java.io.InputStream rsdlAsStrem = null ; try { rsdlAsStrem = org.ovirt.engine.api.rsdl.RsdlIOManager.loadAsStream ( fileName ) ; return javax.xml.bind.JAXB.unmarshal ( rsdlAsStrem , org.ovirt.engine.api.model.RSDL.class ) ; } finally { if ( rsdlAsStrem != null ) { rsdlAsStrem.close ( ) ; } } }

Target:
public static org.ovirt.engine.api.model.RSDL loadRsdl ( org.ovirt.engine.core.common.mode.ApplicationMode applicationMode , java.lang.String prefix ) throws java.io.IOException { java.lang.String fileName = ( applicationMode == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) ? "/" + ( RsdlIOManager.GLUSTER_RSDL_RESOURCE_NAME ) : "/" + ( RsdlIOManager.RSDL_RESOURCE_NAME ) ; org.w3c.dom.Document document ; try { javax.xml.parsers.DocumentBuilder parser = javax.xml.parsers.DocumentBuilderFactory.newInstance ( ) . newDocumentBuilder ( ) ; try ( java.io.InputStream in = org.ovirt.engine.api.rsdl.RsdlIOManager.loadAsStream ( fileName ) ) { document = parser.parse ( in ) ; } javax.xml.xpath.XPath xpath = javax.xml.xpath.XPathFactory.newInstance ( ) . newXPath ( ) ; org.w3c.dom.NodeList nodes = ( ( org.w3c.dom.NodeList ) ( xpath.evaluate ( "//@href" , document , javax.xml.xpath.XPathConstants.NODESET ) ) ) ; for ( int i = 0 ; i < ( nodes.getLength ( ) ) ; i ++ ) { org.w3c.dom.Node node = nodes.item ( i ) ; java.lang.String href = node.getNodeValue ( ) ; if ( href.startsWith ( org.ovirt.engine.api.rsdl.RsdlManager.QUERY_PARAMETER ) ) { href = prefix + href ; } else { href = ( prefix + "/" ) + href ; } node.setNodeValue ( href ) ; } } catch ( java.lang.Exception exception ) { throw new java.io.IOException ( exception ) ; } return javax.xml.bind.JAXB.unmarshal ( new javax.xml.transform.dom.DOMSource ( document ) , org.ovirt.engine.api.model.RSDL.class ) ; }
Source:
protected void executeQueryCommand ( ) { P params = org.ovirt.engine.core.bll.GetDataCentersWithPermittedActionOnClustersQuery.getParameters ( ) ; setReturnValue ( org.ovirt.engine.core.bll.GetDataCentersWithPermittedActionOnClustersQuery.getDbFacade ( ) . getStoragePoolDao ( ) . getDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.core.bll.GetDataCentersWithPermittedActionOnClustersQuery.getUserID ( ) , params.getActionGroup ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { P params = org.ovirt.engine.core.bll.GetDataCentersWithPermittedActionOnClustersQuery.getParameters ( ) ; setReturnValue ( org.ovirt.engine.core.bll.GetDataCentersWithPermittedActionOnClustersQuery.getDbFacade ( ) . getStoragePoolDao ( ) . getDataCentersWithPermittedActionOnClusters ( org.ovirt.engine.core.bll.GetDataCentersWithPermittedActionOnClustersQuery.getUserID ( ) , params.getActionGroup ( ) , params.isSupportsVirtService ( ) , params.isSupportsGlusterService ( ) ) ) ; }
Source:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , bond.getName ( ) ) ) ; doTestValidModifiedBonds ( bond , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond = createNewCreateOrUpdateBond ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "bond1" , "slaveA" , "slaveB" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( createOrUpdateBond ) ) . build ( ) ; doTestValidateModifiedBondSlaves ( org.mockito.Mockito.spy ( validator ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public void setEnumTitle ( java.lang.Enum < ? > enumObj ) { java.lang.String title = "" ; if ( enumObj != null ) { org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.Create ( enumObj.getDeclaringClass ( ) ) ; try { title = translator.get ( enumObj ) ; } catch ( java.util.MissingResourceException e ) { title = enumObj.name ( ) ; } } setTitle ( title ) ; }

Target:
public void setEnumTitle ( java.lang.Enum < ? > enumObj ) { setTitle ( org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( enumObj ) ) ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryUser instantiate ( com.google.gwt.user.client.rpc.SerializationStreamReader reader ) throws com.google.gwt.user.client.rpc.SerializationException { java.lang.String directoryName = reader.readString ( ) ; java.lang.String namespace = reader.readString ( ) ; java.lang.String id = reader.readString ( ) ; java.lang.String name = reader.readString ( ) ; java.lang.String principal = reader.readString ( ) ; return new org.ovirt.engine.core.aaa.DirectoryUser ( directoryName , namespace , id , name , principal ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryUser instantiate ( com.google.gwt.user.client.rpc.SerializationStreamReader reader ) throws com.google.gwt.user.client.rpc.SerializationException { java.lang.String directoryName = reader.readString ( ) ; java.lang.String namespace = reader.readString ( ) ; java.lang.String id = reader.readString ( ) ; java.lang.String name = reader.readString ( ) ; java.lang.String principal = reader.readString ( ) ; java.lang.String displayName = reader.readString ( ) ; return new org.ovirt.engine.core.aaa.DirectoryUser ( directoryName , namespace , id , name , principal , displayName ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.update ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateProvider , org.ovirt.engine.core.common.action.ProviderParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.update ( getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private boolean validateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.ExportRepoImageCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) . validateDiskIsNotLun ( ) ) ) ) ) { return false ; } if ( ( getDiskImage ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; } return true ; }

Target:
private boolean validateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.ExportRepoImageCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) . validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ) ) ) { return false ; } if ( ( getDiskImage ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; } return true ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc vmUpdateDevice ( java.lang.String vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device.getInnerMap ( ) ) ; 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:
public void before ( ) { org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.injectorRule.bind ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class ) ) ; }

Target:
public void before ( ) { org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.injectorRule.bind ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class ) ) ; org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.injectorRule.bind ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class ) ) ; glusterManager = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.gluster.GlusterSyncJob.getInstance ( ) ) ; }
Source:
public org.ovirt.engine.sdk.entities.Action rebalance ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/rebalance" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action rebalance ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/rebalance" ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }