private void initPackageArray() {
        Set set = new HashSet(Arrays.asList(root.specifiedPackages()));
        ClassDoc[] classes = root.specifiedClasses();
        for (int i = 0; i < classes.length; i++) {
            set.add(classes[i].containingPackage());
        }
        ArrayList results = new ArrayList(set);
        Collections.sort(results);
        packages = (PackageDoc[]) results.toArray(new PackageDoc[] {});
    }