From 4a519eb7b1bb3ee5c72bd28b7447313258597f7b Mon Sep 17 00:00:00 2001 From: paltherr Date: Thu, 27 Jan 2005 17:17:34 +0000 Subject: - Split the Reporter class into a Reporter inte... - Split the Reporter class into a Reporter interface and an AbstractReporter and a ConsoleReporter class. --- sources/scalac/CompilerCommand.java | 10 ++++++---- sources/scalac/Global.java | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'sources/scalac') diff --git a/sources/scalac/CompilerCommand.java b/sources/scalac/CompilerCommand.java index d2e244b271..03089f1d49 100644 --- a/sources/scalac/CompilerCommand.java +++ b/sources/scalac/CompilerCommand.java @@ -14,6 +14,7 @@ import java.util.List; import scala.tools.util.ClassPath; import scala.tools.util.Reporter; +import scala.tools.util.ConsoleReporter; import scalac.util.CommandParser; import scalac.util.ArgumentParser; @@ -305,10 +306,11 @@ public class CompilerCommand extends CommandParser { */ public boolean parse(String[] args) { boolean result = super.parse(args); - reporter().nowarn = nowarn.value; - reporter().verbose = verbose.value; - reporter().prompt = prompt.value; - reporter().shortname = Xshortname.value; + reporter().verbose(verbose.value); + reporter().nowarn(nowarn.value); + reporter().prompt(prompt.value); + if (reporter() instanceof ConsoleReporter) + ((ConsoleReporter)reporter()).shortname = Xshortname.value; return result; } diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java index 8d220bfdc5..ead3469865 100644 --- a/sources/scalac/Global.java +++ b/sources/scalac/Global.java @@ -190,7 +190,7 @@ public abstract class Global { }; public static Timer getTimer(Reporter reporter) { - return reporter.verbose + return reporter.verbose() ? (Timer)new ReporterTimer(reporter) : (Timer)DummyTimer.object; } @@ -229,7 +229,7 @@ public abstract class Global { this.printtypes = args.types.value; this.printtokens = args.print.tokens; this.classPath = args.classpath(); - if (reporter.verbose) reporter.inform("classpath = " + classPath); + reporter.info(null, "classpath = " + classPath, false); this.outpath = args.outpath(); String encoding = args.encoding.value; Charset charset = null; @@ -632,7 +632,7 @@ public abstract class Global { /** issue an operation note */ public void operation(String message) { - reporter.inform("[" + message + "]"); + reporter.info(null, "[" + message + "]", false); } /** issue a debug message from currentPhase @@ -640,7 +640,7 @@ public abstract class Global { // the boolean return value is here to let one write "assert log( ... )" public boolean log(String message) { if (log()) { - reporter.report("[log " + currentPhase + "] " + message); + reporter.info(null, "[log " + currentPhase + "] " + message, true); } return true; } -- cgit v1.2.3