1 /* |
1 /* |
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
255 Map<String,Boolean> includedPackages = new HashMap<String,Boolean>(); |
255 Map<String,Boolean> includedPackages = new HashMap<String,Boolean>(); |
256 includedPackages.put("", true); |
256 includedPackages.put("", true); |
257 for (String p: excludedPackages) |
257 for (String p: excludedPackages) |
258 includedPackages.put(p, false); |
258 includedPackages.put(p, false); |
259 |
259 |
260 if (docenv.fileManager.hasLocation(StandardLocation.SOURCE_PATH)) { |
260 StandardLocation path = docenv.fileManager.hasLocation(StandardLocation.SOURCE_PATH) |
261 searchSubPackages(subPackages, |
261 ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH; |
262 includedPackages, |
262 |
263 packages, packageFiles, |
263 searchSubPackages(subPackages, |
264 StandardLocation.SOURCE_PATH, |
264 includedPackages, |
265 EnumSet.of(JavaFileObject.Kind.SOURCE)); |
265 packages, packageFiles, |
266 searchSubPackages(subPackages, |
266 path, |
267 includedPackages, |
267 EnumSet.of(JavaFileObject.Kind.SOURCE)); |
268 packages, packageFiles, |
268 |
269 StandardLocation.CLASS_PATH, |
|
270 EnumSet.of(JavaFileObject.Kind.CLASS)); |
|
271 } else { |
|
272 searchSubPackages(subPackages, |
|
273 includedPackages, |
|
274 packages, packageFiles, |
|
275 StandardLocation.CLASS_PATH, |
|
276 EnumSet.of(JavaFileObject.Kind.SOURCE, JavaFileObject.Kind.CLASS)); |
|
277 } |
|
278 return packageFiles; |
269 return packageFiles; |
279 } |
270 } |
280 |
271 |
281 private void searchSubPackages(List<String> subPackages, |
272 private void searchSubPackages(List<String> subPackages, |
282 Map<String,Boolean> includedPackages, |
273 Map<String,Boolean> includedPackages, |