code: public void flattenArtifacts(Map<String,Module> m) {
          modules = m;
          // Extract all the found packages.
          for (Module i : modules.values()) {
              for (Map.Entry<String,Package> j : i.packages().entrySet()) {
                  Package p = packages.get(j.getKey());
                  // Check that no two different packages are stored under same name.
                  Assert.check(p == null || p == j.getValue());
                  p = j.getValue();
                  packages.put(j.getKey(),j.getValue());
                  for (Map.Entry<String,File> g : p.artifacts().entrySet()) {
                      File f = artifacts.get(g.getKey());
                      // Check that no two artifacts are stored under the same file.
                      Assert.check(f == null || f == g.getValue());
                      artifacts.put(g.getKey(), g.getValue());
                  }
              }
          }
      }
docs: Store references to all artifacts found in the module tree into the maps
  stored in the build state.
  
  @param m The set of modules.