[JAMESII-364] "StringBuffer out" parameter in initComputationTask(...) seems to be unused Created: 02/Jul/13  Updated: 03/Jul/13  Resolved: 03/Jul/13

Status: Resolved
Project: James II
Component/s: Core
Affects Version/s: None
Fix Version/s: None
Security Level: public (Visible to EVERYONE.)

Type: Improvement Priority: Minor
Reporter: Arne Bittig Assignee: re027
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes

Attachments: Zip Archive mylyn-context.zip    


initComputationTask(IComputationTaskConfiguration, IModelReader, RunInformation, StringBuffer, List<ISimulationServer>), several methods called by it, and the constructor of ExecutionMeasurement used therein, have an "out" parameter that could be used to log messages to the given StringBuffer in addition to the usual log output. Hoever, it seems whereever the method is called the parameter value is null (except for tests, where it is new StringBuffer(), i.e. it is not referenced anywhere again, either).

The javadoc does not elucidate the purpose well, either:
"@param out

  • the out"

(I noticed this when inlining the only two report methods from Entity – see https://altair.informatik.uni-rostock.de/jira/browse/JAMESII-348 – that actually contained some logic (as opposed to a single call to another method), which were incidentally only used in the context above.)

Comment by re027 [ 03/Jul/13 ]

As far as I see it, the string buffer is used in SimulationRunSetup#handleError. I fixed (and updated) the javadocs.

Comment by Arne Bittig [ 03/Jul/13 ]

Pardon me? handleError is only ever called by initComputationTask, is it not? So how can it "use" the parameter if this one never has a useful value in initComputationTask in the first place?

Comment by re027 [ 03/Jul/13 ]

Anyhow, if nobody really uses it we could (should) still remove it. I have checked the code to include external formalisms and this does not really use it either (but maybe it should?). We could simply say that output management is handled via logging (this is how it is currently done in the external formalisms code).

Comment by re027 [ 03/Jul/13 ]

My point was just that out will be handled correctly by our default task setup, so it can be used. Sorry about the confusion.

Comment by re027 [ 03/Jul/13 ]

So, instead rather remove it altogether?

Comment by re027 [ 03/Jul/13 ]

I now removed the out parameter as suggested. To propagate the output of external processes org.jamesii.core.util.misc.exec.StreamReader should be used, and to post-process such output one could add a org.jamesii.core.util.logging.ILogListener to the org.jamesii.core.util.logging.ApplicationLogger.

Generated at Fri Aug 14 07:59:15 CEST 2020 using JIRA 5.0.7#734-sha1:8ad78a62c71cf08b03545eb446cc3b9bb5ce37ad.