diff options
author | paltherr <paltherr@epfl.ch> | 2004-12-13 08:28:31 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-12-13 08:28:31 +0000 |
commit | 35f02f5fc8f5edfed0e1c6e5259e2fe9a7ea48aa (patch) | |
tree | f4ef9b298b31c723319b4479360b71e9c4a0526b /sources/scalac/symtab/classfile/PackageParser.java | |
parent | e4a6367b05d3105994f4140a0c0fbe6e2b579340 (diff) | |
download | scala-35f02f5fc8f5edfed0e1c6e5259e2fe9a7ea48aa.tar.gz scala-35f02f5fc8f5edfed0e1c6e5259e2fe9a7ea48aa.tar.bz2 scala-35f02f5fc8f5edfed0e1c6e5259e2fe9a7ea48aa.zip |
- Added method isValidName
Diffstat (limited to 'sources/scalac/symtab/classfile/PackageParser.java')
-rw-r--r-- | sources/scalac/symtab/classfile/PackageParser.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sources/scalac/symtab/classfile/PackageParser.java b/sources/scalac/symtab/classfile/PackageParser.java index 073ebe504f..05e1276cf7 100644 --- a/sources/scalac/symtab/classfile/PackageParser.java +++ b/sources/scalac/symtab/classfile/PackageParser.java @@ -58,6 +58,13 @@ public class PackageParser extends SymbolLoader { //######################################################################## // Protected Methods + /** Is the given name a valid input file base name? */ + protected boolean isValidName(String name) { + return name.length() > 0 + &&!name.endsWith("$class") + && name.indexOf("$$anon") == -1; + } + /** Returns a new package parser for the given directory. */ protected PackageParser newPackageParser(AbstractFile directory) { return new PackageParser(global, directory); @@ -78,16 +85,19 @@ public class PackageParser extends SymbolLoader { } if (filename.endsWith(".class")) { String name = filename.substring(0, filename.length() - 6); + if (!isValidName(name)) continue; if (!classes.containsKey(name)) classes.put(name, file); continue; } if (filename.endsWith(".symbl")) { String name = filename.substring(0, filename.length() - 6); + if (!isValidName(name)) continue; if (!symbols.containsKey(name)) symbols.put(name, file); continue; } if (filename.endsWith(".scala")) { String name = filename.substring(0, filename.length() - 6); + if (!isValidName(name)) continue; if (!sources.containsKey(name)) sources.put(name, file); continue; } |