1.1 --- a/src/share/classes/com/sun/tools/sjavac/BuildState.java Thu Sep 19 17:05:08 2013 +0200 1.2 +++ b/src/share/classes/com/sun/tools/sjavac/BuildState.java Thu Sep 19 08:26:26 2013 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -81,12 +81,13 @@ 1.11 } 1.12 1.13 /** 1.14 - * Collect all packages, sources and artifacts for all modules 1.15 - * into the build state. 1.16 + * Store references to all packages, sources and artifacts for all modules 1.17 + * into the build state. I.e. flatten the module tree structure 1.18 + * into global maps stored in the BuildState for easy access. 1.19 * 1.20 * @param m The set of modules. 1.21 */ 1.22 - public void collectPackagesSourcesAndArtifacts(Map<String,Module> m) { 1.23 + public void flattenPackagesSourcesAndArtifacts(Map<String,Module> m) { 1.24 modules = m; 1.25 // Extract all the found packages. 1.26 for (Module i : modules.values()) { 1.27 @@ -121,11 +122,12 @@ 1.28 } 1.29 1.30 /** 1.31 - * Collect all the artifacts of all modules and packages. 1.32 + * Store references to all artifacts found in the module tree into the maps 1.33 + * stored in the build state. 1.34 * 1.35 * @param m The set of modules. 1.36 */ 1.37 - public void collectArtifacts(Map<String,Module> m) { 1.38 + public void flattenArtifacts(Map<String,Module> m) { 1.39 modules = m; 1.40 // Extract all the found packages. 1.41 for (Module i : modules.values()) { 1.42 @@ -270,6 +272,8 @@ 1.43 Module mnew = findModuleFromPackageName(pkg); 1.44 Package pprev = prev.packages().get(pkg); 1.45 mnew.addPackage(pprev); 1.46 + // Do not forget to update the flattened data. 1.47 + packages.put(pkg, pprev); 1.48 } 1.49 } 1.50 }