diff options
author | Janek Bogucki <janekdb@gmail.com> | 2015-11-23 20:34:24 +0000 |
---|---|---|
committer | Janek Bogucki <janekdb@gmail.com> | 2015-11-23 20:34:24 +0000 |
commit | 35dd1a9a07aa5e993212cef5fd401f5534a4725a (patch) | |
tree | 4fa6743d2e4a289754a18196349186ad5888fa7c /src | |
parent | 72b855f978b1d2695ca4a2ae942a537c6a6e8f54 (diff) | |
download | scala-35dd1a9a07aa5e993212cef5fd401f5534a4725a.tar.gz scala-35dd1a9a07aa5e993212cef5fd401f5534a4725a.tar.bz2 scala-35dd1a9a07aa5e993212cef5fd401f5534a4725a.zip |
Align DotRunner dot restart count with command option description
This is the command option description,
val docDiagramsDotRestart = IntSetting(
"-diagrams-dot-restart",
"The number of times to restart a malfunctioning dot process before disabling diagrams (default: 5)",
5,
None,
_ => None
)
Prior to this change dot was restarted four times instead of five. Maybe the
intention of the option was to allow a total number of attempts to be specified
but with 5 restarts we need 6 attempts. The local var was renamed to reflect this.
Diffstat (limited to 'src')
-rw-r--r-- | src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala index 9381cf3a35..9287bfbc2b 100644 --- a/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala +++ b/src/scaladoc/scala/tools/nsc/doc/html/page/diagram/DotRunner.scala @@ -18,16 +18,16 @@ import model._ /** This class takes care of running the graphviz dot utility */ class DotRunner(settings: doc.Settings) { - private[this] var dotRestarts = 0 + private[this] var dotAttempts = 0 private[this] var dotProcess: DotProcess = null def feedToDot(dotInput: String, template: DocTemplateEntity): String = { if (dotProcess == null) { - if (dotRestarts < settings.docDiagramsDotRestart.value) { - if (dotRestarts != 0) + if (dotAttempts < settings.docDiagramsDotRestart.value + 1) { + if (dotAttempts > 0) settings.printMsg("Graphviz will be restarted...\n") - dotRestarts += 1 + dotAttempts += 1 dotProcess = new DotProcess(settings) } else return null @@ -41,7 +41,7 @@ class DotRunner(settings: doc.Settings) { if (result == null) { dotProcess.cleanup() dotProcess = null - if (dotRestarts == settings.docDiagramsDotRestart.value) { + if (dotAttempts == 1 + settings.docDiagramsDotRestart.value) { settings.printMsg("\n") settings.printMsg("**********************************************************************") settings.printMsg("Diagrams will be disabled for this run because the graphviz dot tool") |