Skip to content

Commit

Permalink
MiniMaven: avoid re-parsing files that were already parsed
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jul 6, 2012
1 parent 2f6ea69 commit 9333948
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src-plugins/fake/src/main/java/fiji/build/MiniMaven.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class MiniMaven {
protected int updateInterval = 24 * 60; // by default, check once per 24h for new snapshot versions
protected PrintStream err;
protected Map<String, POM> localPOMCache = new HashMap<String, POM>();
protected Map<File, POM> file2pom = new HashMap<File, POM>();
protected Stack<File> multiProjectRoots = new Stack<File>();
protected Set<File> excludedFromMultiProjects = new HashSet<File>();
protected Fake fake;
Expand Down Expand Up @@ -114,6 +115,9 @@ public POM parse(File file, POM parent) throws IOException, ParserConfigurationE
}

public POM parse(File file, POM parent, String classifier) throws IOException, ParserConfigurationException, SAXException {
if (file2pom.containsKey(file))
return file2pom.get(file);

if (!file.exists())
return null;
if (verbose)
Expand Down Expand Up @@ -181,6 +185,7 @@ public POM parse(File file, POM parent, String classifier) throws IOException, P
if (!localPOMCache.containsKey(key))
localPOMCache.put(key, pom);

file2pom.put(file, pom);
return pom;
}

Expand Down

0 comments on commit 9333948

Please sign in to comment.