Commit 4a525b62 authored by Jesper Öqvist's avatar Jesper Öqvist
Browse files

Refactoring

parent e53706ab
......@@ -108,8 +108,17 @@ aspect PathPart {
// load files from a folder
class FolderPart extends PathPart {
private HashMap map = new HashMap();
private File folder;
/**
* Maps package names to a collection of the files in
* the corresponding package directory.
*/
private HashMap packageMap = new HashMap();
/**
* The root folder of this path part.
*/
private final File folder;
public FolderPart(File folder) {
this.folder = folder;
......@@ -129,7 +138,7 @@ aspect PathPart {
}
private Collection filesInPackage(String packageName) {
if(!map.containsKey(packageName)) {
if(!packageMap.containsKey(packageName)) {
File f = new File(folder, packageName.replace('.', File.separatorChar));
Collection c = Collections.EMPTY_LIST;
if(f.exists() && f.isDirectory()) {
......@@ -142,9 +151,9 @@ aspect PathPart {
}
else
c = null;
map.put(packageName, c);
packageMap.put(packageName, c);
}
return (Collection)map.get(packageName);
return (Collection)packageMap.get(packageName);
}
public boolean selectCompilationUnit(String canonicalName) throws IOException {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment