diff options
author | paltherr <paltherr@epfl.ch> | 2004-03-21 04:31:47 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-03-21 04:31:47 +0000 |
commit | ca196dd13c1008176b162d006838767e8b4d83b7 (patch) | |
tree | 813851163262df10d74c2f332647bcfaffc30a54 /sources/scalac/util | |
parent | 92763237f37452a9325e94f63ad5b7faa4ac04ca (diff) | |
download | scala-ca196dd13c1008176b162d006838767e8b4d83b7.tar.gz scala-ca196dd13c1008176b162d006838767e8b4d83b7.tar.bz2 scala-ca196dd13c1008176b162d006838767e8b4d83b7.zip |
- Replaced file String by an AbstractFile in So...
- Replaced file String by an AbstractFile in SourceFile
Diffstat (limited to 'sources/scalac/util')
-rw-r--r-- | sources/scalac/util/ClassPath.java | 13 | ||||
-rw-r--r-- | sources/scalac/util/Reporter.java | 17 |
2 files changed, 9 insertions, 21 deletions
diff --git a/sources/scalac/util/ClassPath.java b/sources/scalac/util/ClassPath.java index 6e68be350a..1745141079 100644 --- a/sources/scalac/util/ClassPath.java +++ b/sources/scalac/util/ClassPath.java @@ -153,19 +153,6 @@ public class ClassPath { "' not found in classpath"); } - public java.io.File openJavaFile(String name) throws FileNotFoundException { - if (printSearch) - System.out.println("looking for " + name); - for (int i = 0; i < root.length; i++) { - if (printSearch) - System.out.println(" in " + root[i]); - java.io.File f = new File(root[i], name); - if (f.exists()) return f; - } - throw new FileNotFoundException("file '" + name + - "' not found in classpath"); - } - public String[] components() { return root; } diff --git a/sources/scalac/util/Reporter.java b/sources/scalac/util/Reporter.java index d765ec98e1..70206f46b8 100644 --- a/sources/scalac/util/Reporter.java +++ b/sources/scalac/util/Reporter.java @@ -152,12 +152,12 @@ public class Reporter { public void printMessage(Position position, String message) { if (position != null) { message = " " + message; - if (position.line() != 0) - message = position.line() + ":" + message; + if (position.getLineNumber() != 0) + message = position.getLineNumber() + ":" + message; if (shortname) - message = position.file().getShortName() + ":" + message; + message = position.getName() + ":" + message; else - message = position.file().name() + ":" + message; + message = position.getPath() + ":" + message; } printMessage(message); printSourceLine(position); @@ -183,14 +183,15 @@ public class Reporter { /** Prints the source line of the given position. */ public void printSourceLine(Position position) { - if (position == null || position.line() == 0) return; - printMessage(position.file().getLine(position.line())); + String line = position == null ? null : position.getLineContent(); + if (line == null) return; + printMessage(line); printColumnMarker(position); } /** Prints the column marker of the given position. */ public void printColumnMarker(Position position) { - int column = position == null ? 0 : position.column(); + int column = position == null ? 0 : position.getColumnNumber(); StringBuffer buffer = new StringBuffer(column); for (int i = 1; i < column; i++) buffer.append(' '); if (column > 0) buffer.append('^'); @@ -228,7 +229,7 @@ public class Reporter { /** Logs a position and returns true if it was already logged. */ private boolean testAndLog(Position position) { if (position == null) return false; - if (position.column() == 0) return false; + if (position.getColumnNumber() == 0) return false; if (positions.contains(position)) return true; positions.add(position); return false; |