diff options
author | Martin Odersky <odersky@gmail.com> | 2003-08-04 09:43:44 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2003-08-04 09:43:44 +0000 |
commit | 8ccfe152e029e2a0a1a444bea8ab7cb686f7cd5b (patch) | |
tree | 739662fa27505299c547c34d7d981b0366bb6032 /sources/scalac/symtab/SourceCompleter.java | |
parent | e41aa28a336a5d6ac3e838780b2b70753c00eb3c (diff) | |
download | scala-8ccfe152e029e2a0a1a444bea8ab7cb686f7cd5b.tar.gz scala-8ccfe152e029e2a0a1a444bea8ab7cb686f7cd5b.tar.bz2 scala-8ccfe152e029e2a0a1a444bea8ab7cb686f7cd5b.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac/symtab/SourceCompleter.java')
-rw-r--r-- | sources/scalac/symtab/SourceCompleter.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sources/scalac/symtab/SourceCompleter.java b/sources/scalac/symtab/SourceCompleter.java index cf4938ccde..f835160b50 100644 --- a/sources/scalac/symtab/SourceCompleter.java +++ b/sources/scalac/symtab/SourceCompleter.java @@ -21,12 +21,10 @@ public class SourceCompleter extends Type.LazyType { /** the global compilation environment */ protected Global global; - protected String filename; private boolean completed = false; - public SourceCompleter(Global global, String filename) { + public SourceCompleter(Global global) { this.global = global; - this.filename = filename; } /** complete class symbol c by loading the unit @@ -34,15 +32,16 @@ public class SourceCompleter extends Type.LazyType { public void complete(Symbol c) { if (completed) { c.setInfo(Type.NoType); - } else if (filename != null) { + } else { try { - String fname = filename; long msec = System.currentTimeMillis(); - Unit unit = new Unit(global, new SourceFile(filename), false); - filename = null; + String filename = SourceRepresentation.externalizeFileName( + c.fullName()) + ".scala"; + java.io.File f = global.classPath.openJavaFile(filename); + Unit unit = new Unit(global, new SourceFile(f), false); global.PHASE.PARSER.apply(unit); global.PHASE.ANALYZER.lateEnter(global, unit, c); - global.operation("added " + fname + " in " + + global.operation("added " + filename + " in " + (System.currentTimeMillis() - msec) + "ms"); } catch (IOException e) { e.printStackTrace(); |