src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java

changeset 2023
cf37c3775397
parent 1997
f050c714b556
child 2413
fe033d997ddf
     1.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Wed Sep 11 08:30:58 2013 -0400
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Wed Sep 11 14:50:11 2013 -0700
     1.3 @@ -396,6 +396,9 @@
     1.4              interimResults.put(p, new ArrayList<PackageDoc>());
     1.5  
     1.6          for (PackageDoc pkg: packages) {
     1.7 +            if (nodeprecated && Util.isDeprecated(pkg)) {
     1.8 +                continue;
     1.9 +            }
    1.10              // the getProfile method takes a type name, not a package name,
    1.11              // but isn't particularly fussy about the simple name -- so just use *
    1.12              int i = profiles.getProfile(pkg.name().replace(".", "/") + "/*");
    1.13 @@ -409,12 +412,17 @@
    1.14          // Build the profilePackages structure used by the doclet
    1.15          profilePackages = new HashMap<String,PackageDoc[]>();
    1.16          List<PackageDoc> prev = Collections.<PackageDoc>emptyList();
    1.17 +        int size;
    1.18          for (Map.Entry<Profile,List<PackageDoc>> e: interimResults.entrySet()) {
    1.19              Profile p = e.getKey();
    1.20              List<PackageDoc> pkgs =  e.getValue();
    1.21              pkgs.addAll(prev); // each profile contains all lower profiles
    1.22              Collections.sort(pkgs);
    1.23 -            profilePackages.put(p.name, pkgs.toArray(new PackageDoc[pkgs.size()]));
    1.24 +            size = pkgs.size();
    1.25 +            // For a profile, if there are no packages to be documented, do not add
    1.26 +            // it to profilePackages map.
    1.27 +            if (size > 0)
    1.28 +                profilePackages.put(p.name, pkgs.toArray(new PackageDoc[pkgs.size()]));
    1.29              prev = pkgs;
    1.30          }
    1.31  
    1.32 @@ -719,6 +727,17 @@
    1.33      }
    1.34  
    1.35      /**
    1.36 +     * Check the validity of the given profile. Return false if there are no
    1.37 +     * valid packages to be documented for the profile.
    1.38 +     *
    1.39 +     * @param profileName the profile that needs to be validated.
    1.40 +     * @return true if the profile has valid packages to be documented.
    1.41 +     */
    1.42 +    public boolean shouldDocumentProfile(String profileName) {
    1.43 +        return profilePackages.containsKey(profileName);
    1.44 +    }
    1.45 +
    1.46 +    /**
    1.47       * Check the validity of the given Source or Output File encoding on this
    1.48       * platform.
    1.49       *

mercurial