6657907: javadoc has unchecked warnings

Tue, 15 Jul 2008 19:22:51 -0700

author
jjg
date
Tue, 15 Jul 2008 19:22:51 -0700
changeset 74
5a9172b251dd
parent 73
1cf29847eb6e
child 75
13aee98cc0d8

6657907: javadoc has unchecked warnings
Reviewed-by: bpatel

src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javadoc/DocletInvoker.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javadoc/JavadocEnter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javadoc/SerializedForm.java file | annotate | diff | comparison | revisions
src/share/classes/com/sun/tools/javah/Gen.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Tue Jul 15 09:50:36 2008 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Tue Jul 15 19:22:51 2008 -0700
     1.3 @@ -345,18 +345,18 @@
     1.4      /**
     1.5       * Print use info.
     1.6       */
     1.7 -    protected void printUseInfo(Object mems, String heading) {
     1.8 +    protected void printUseInfo(List<? extends ProgramElementDoc> mems, String heading) {
     1.9          if (mems == null) {
    1.10              return;
    1.11          }
    1.12 -        List members = (List)mems;
    1.13 +        List<? extends ProgramElementDoc> members = mems;
    1.14          if (members.size() > 0) {
    1.15              writer.tableIndexSummary();
    1.16              writer.tableUseInfoHeaderStart("#CCCCFF");
    1.17              writer.print(heading);
    1.18              writer.tableHeaderEnd();
    1.19 -            for (Iterator it = members.iterator(); it.hasNext(); ) {
    1.20 -                ProgramElementDoc pgmdoc = (ProgramElementDoc)it.next();
    1.21 +            for (Iterator<? extends ProgramElementDoc> it = members.iterator(); it.hasNext(); ) {
    1.22 +                ProgramElementDoc pgmdoc = it.next();
    1.23                  ClassDoc cd = pgmdoc.containingClass();
    1.24  
    1.25                  writer.printSummaryLinkType(this, pgmdoc);
     2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Tue Jul 15 09:50:36 2008 -0700
     2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Tue Jul 15 19:22:51 2008 -0700
     2.3 @@ -39,28 +39,28 @@
     2.4  
     2.5      final ClassDoc classdoc;
     2.6      Set pkgToPackageAnnotations = null;
     2.7 -    final Map pkgToClassTypeParameter;
     2.8 -    final Map pkgToClassAnnotations;
     2.9 -    final Map pkgToMethodTypeParameter;
    2.10 -    final Map pkgToMethodArgTypeParameter;
    2.11 -    final Map pkgToMethodReturnTypeParameter;
    2.12 -    final Map pkgToMethodAnnotations;
    2.13 -    final Map pkgToMethodParameterAnnotations;
    2.14 -    final Map pkgToFieldTypeParameter;
    2.15 -    final Map pkgToFieldAnnotations;
    2.16 -    final Map pkgToSubclass;
    2.17 -    final Map pkgToSubinterface;
    2.18 -    final Map pkgToImplementingClass;
    2.19 -    final Map pkgToField;
    2.20 -    final Map pkgToMethodReturn;
    2.21 -    final Map pkgToMethodArgs;
    2.22 -    final Map pkgToMethodThrows;
    2.23 -    final Map pkgToConstructorAnnotations;
    2.24 -    final Map pkgToConstructorParameterAnnotations;
    2.25 -    final Map pkgToConstructorArgs;
    2.26 -    final Map pkgToConstructorArgTypeParameter;
    2.27 -    final Map pkgToConstructorThrows;
    2.28 -    final SortedSet pkgSet;
    2.29 +    final Map<String,List<ProgramElementDoc>> pkgToClassTypeParameter;
    2.30 +    final Map<String,List<ProgramElementDoc>> pkgToClassAnnotations;
    2.31 +    final Map<String,List<ProgramElementDoc>> pkgToMethodTypeParameter;
    2.32 +    final Map<String,List<ProgramElementDoc>> pkgToMethodArgTypeParameter;
    2.33 +    final Map<String,List<ProgramElementDoc>> pkgToMethodReturnTypeParameter;
    2.34 +    final Map<String,List<ProgramElementDoc>> pkgToMethodAnnotations;
    2.35 +    final Map<String,List<ProgramElementDoc>> pkgToMethodParameterAnnotations;
    2.36 +    final Map<String,List<ProgramElementDoc>> pkgToFieldTypeParameter;
    2.37 +    final Map<String,List<ProgramElementDoc>> pkgToFieldAnnotations;
    2.38 +    final Map<String,List<ProgramElementDoc>> pkgToSubclass;
    2.39 +    final Map<String,List<ProgramElementDoc>> pkgToSubinterface;
    2.40 +    final Map<String,List<ProgramElementDoc>> pkgToImplementingClass;
    2.41 +    final Map<String,List<ProgramElementDoc>> pkgToField;
    2.42 +    final Map<String,List<ProgramElementDoc>> pkgToMethodReturn;
    2.43 +    final Map<String,List<ProgramElementDoc>> pkgToMethodArgs;
    2.44 +    final Map<String,List<ProgramElementDoc>> pkgToMethodThrows;
    2.45 +    final Map<String,List<ProgramElementDoc>> pkgToConstructorAnnotations;
    2.46 +    final Map<String,List<ProgramElementDoc>> pkgToConstructorParameterAnnotations;
    2.47 +    final Map<String,List<ProgramElementDoc>> pkgToConstructorArgs;
    2.48 +    final Map<String,List<ProgramElementDoc>> pkgToConstructorArgTypeParameter;
    2.49 +    final Map<String,List<ProgramElementDoc>> pkgToConstructorThrows;
    2.50 +    final SortedSet<PackageDoc> pkgSet;
    2.51      final MethodWriterImpl methodSubWriter;
    2.52      final ConstructorWriterImpl constrSubWriter;
    2.53      final FieldWriterImpl fieldSubWriter;
    2.54 @@ -81,9 +81,9 @@
    2.55          super(configuration, path, filename, relpath);
    2.56          this.classdoc = classdoc;
    2.57          if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
    2.58 -                pkgToPackageAnnotations = new HashSet((List) mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
    2.59 +                pkgToPackageAnnotations = new HashSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
    2.60          configuration.currentcd = classdoc;
    2.61 -        this.pkgSet = new TreeSet();
    2.62 +        this.pkgSet = new TreeSet<PackageDoc>();
    2.63          this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
    2.64          this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
    2.65          this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
    2.66 @@ -135,19 +135,19 @@
    2.67          }
    2.68      }
    2.69  
    2.70 -    private Map pkgDivide(Map classMap) {
    2.71 -        Map map = new HashMap();
    2.72 -        List list= (List)classMap.get(classdoc.qualifiedName());
    2.73 +    private Map<String,List<ProgramElementDoc>> pkgDivide(Map<String,? extends List<? extends ProgramElementDoc>> classMap) {
    2.74 +        Map<String,List<ProgramElementDoc>> map = new HashMap<String,List<ProgramElementDoc>>();
    2.75 +        List<? extends ProgramElementDoc> list= classMap.get(classdoc.qualifiedName());
    2.76          if (list != null) {
    2.77              Collections.sort(list);
    2.78 -            Iterator it = list.iterator();
    2.79 +            Iterator<? extends ProgramElementDoc> it = list.iterator();
    2.80              while (it.hasNext()) {
    2.81 -                ProgramElementDoc doc = (ProgramElementDoc)it.next();
    2.82 +                ProgramElementDoc doc = it.next();
    2.83                  PackageDoc pkg = doc.containingPackage();
    2.84                  pkgSet.add(pkg);
    2.85 -                List inPkg = (List)map.get(pkg.name());
    2.86 +                List<ProgramElementDoc> inPkg = map.get(pkg.name());
    2.87                  if (inPkg == null) {
    2.88 -                    inPkg = new ArrayList();
    2.89 +                    inPkg = new ArrayList<ProgramElementDoc>();
    2.90                      map.put(pkg.name(), inPkg);
    2.91                  }
    2.92                  inPkg.add(doc);
     3.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Tue Jul 15 09:50:36 2008 -0700
     3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Tue Jul 15 19:22:51 2008 -0700
     3.3 @@ -253,7 +253,7 @@
     3.4              }
     3.5          }
     3.6          if (root.specifiedClasses().length > 0) {
     3.7 -            Map map = new HashMap();
     3.8 +            Map<String,PackageDoc> map = new HashMap<String,PackageDoc>();
     3.9              PackageDoc pd;
    3.10              ClassDoc[] classes = root.classes();
    3.11              for (int i = 0; i < classes.length; i++) {
    3.12 @@ -481,7 +481,7 @@
    3.13      /**
    3.14       * {@inheritDoc}
    3.15       */
    3.16 -    public Comparator getMemberComparator() {
    3.17 +    public Comparator<ProgramElementDoc> getMemberComparator() {
    3.18          return null;
    3.19      }
    3.20  }
     4.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Tue Jul 15 09:50:36 2008 -0700
     4.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Tue Jul 15 19:22:51 2008 -0700
     4.3 @@ -107,7 +107,7 @@
     4.4      /**
     4.5       * {@inheritDoc}
     4.6       */
     4.7 -    public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set printedPackageHeaders) {
     4.8 +    public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set<String> printedPackageHeaders) {
     4.9          String packageName = pkg.name();
    4.10          //add link to summary
    4.11          li();
     5.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Tue Jul 15 09:50:36 2008 -0700
     5.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Tue Jul 15 19:22:51 2008 -0700
     5.3 @@ -55,10 +55,10 @@
     5.4          super(writer, classDoc);
     5.5          VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc,
     5.6              VisibleMemberMap.CONSTRUCTORS, configuration().nodeprecated);
     5.7 -        List constructors = new ArrayList(visibleMemberMap.getMembersFor(classDoc));
     5.8 +        List<ProgramElementDoc> constructors = new ArrayList<ProgramElementDoc>(visibleMemberMap.getMembersFor(classDoc));
     5.9          for (int i = 0; i < constructors.size(); i++) {
    5.10 -            if (((ProgramElementDoc)(constructors.get(i))).isProtected() ||
    5.11 -                ((ProgramElementDoc)(constructors.get(i))).isPrivate()) {
    5.12 +            if ((constructors.get(i)).isProtected() ||
    5.13 +                (constructors.get(i)).isPrivate()) {
    5.14                  setFoundNonPubConstructor(true);
    5.15              }
    5.16          }
     6.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue Jul 15 09:50:36 2008 -0700
     6.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue Jul 15 19:22:51 2008 -0700
     6.3 @@ -1463,7 +1463,7 @@
     6.4                  int originalLength = result.length();
     6.5                  TagletOutput output = TagletWriter.getInlineTagOuput(
     6.6                      configuration.tagletManager, holderTag,
     6.7 -                    (Tag) tagelem, getTagletWriterInstance(isFirstSentence));
     6.8 +                    tagelem, getTagletWriterInstance(isFirstSentence));
     6.9                  result.append(output == null ? "" : output.toString());
    6.10                  if (originalLength == 0 && isFirstSentence && tagelem.name().equals("@inheritDoc") && result.length() > 0) {
    6.11                      break;
    6.12 @@ -1750,8 +1750,8 @@
    6.13       * @return an array of strings representing the annotations being
    6.14       *         documented.
    6.15       */
    6.16 -    private List getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) {
    6.17 -        List results = new ArrayList();
    6.18 +    private List<String> getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) {
    6.19 +        List<String> results = new ArrayList<String>();
    6.20          StringBuffer annotation;
    6.21          for (int i = 0; i < descList.length; i++) {
    6.22              AnnotationTypeDoc annotationDoc = descList[i].annotationType();
    6.23 @@ -1781,7 +1781,7 @@
    6.24                          pairs[j].element(), pairs[j].element().name(), false));
    6.25                      annotation.append('=');
    6.26                      AnnotationValue annotationValue = pairs[j].value();
    6.27 -                    List annotationTypeValues = new ArrayList();
    6.28 +                    List<AnnotationValue> annotationTypeValues = new ArrayList<AnnotationValue>();
    6.29                      if (annotationValue.value() instanceof AnnotationValue[]) {
    6.30                          AnnotationValue[] annotationArray =
    6.31                              (AnnotationValue[]) annotationValue.value();
     7.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java	Tue Jul 15 09:50:36 2008 -0700
     7.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java	Tue Jul 15 19:22:51 2008 -0700
     7.3 @@ -90,7 +90,7 @@
     7.4              tagletManager.getSerializedFormTags(),
     7.5              writer.getTagletWriterInstance(false), output);
     7.6          print(output.toString());
     7.7 -        MethodDoc method = (MethodDoc)member;
     7.8 +        MethodDoc method = member;
     7.9          if (method.name().compareTo("writeExternal") == 0
    7.10                  && method.tags("serialData").length == 0) {
    7.11              serialWarning(member.position(), "doclet.MissingSerialDataTag",
     8.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Tue Jul 15 09:50:36 2008 -0700
     8.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Tue Jul 15 19:22:51 2008 -0700
     8.3 @@ -73,7 +73,7 @@
     8.4          super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, DirectoryManager.getRelativePath(packageDoc));
     8.5          this.packageDoc = packageDoc;
     8.6          if (configuration.root.specifiedPackages().length == 0) {
     8.7 -            documentedClasses = new HashSet(Arrays.asList(configuration.root.classes()));
     8.8 +            documentedClasses = new HashSet<ClassDoc>(Arrays.asList(configuration.root.classes()));
     8.9          }
    8.10      }
    8.11  
     9.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Tue Jul 15 09:50:36 2008 -0700
     9.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Tue Jul 15 19:22:51 2008 -0700
     9.3 @@ -49,7 +49,7 @@
     9.4       *
     9.5       * @see Group
     9.6       */
     9.7 -    private Map groupPackageMap;
     9.8 +    private Map<String,List<PackageDoc>> groupPackageMap;
     9.9  
    9.10      /**
    9.11       * List to store the order groups as specified on the command line.
    9.12 @@ -120,10 +120,9 @@
    9.13      protected void generateIndex() {
    9.14          for (int i = 0; i < groupList.size(); i++) {
    9.15          String groupname = (String)groupList.get(i);
    9.16 -        List list = (List)groupPackageMap.get(groupname);
    9.17 +        List<PackageDoc> list = groupPackageMap.get(groupname);
    9.18              if (list != null && list.size() > 0) {
    9.19 -                printIndexContents((PackageDoc[])list.
    9.20 -                                       toArray(new PackageDoc[list.size()]),
    9.21 +                printIndexContents(list.toArray(new PackageDoc[list.size()]),
    9.22                                      groupname);
    9.23              }
    9.24          }
    10.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Tue Jul 15 09:50:36 2008 -0700
    10.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Tue Jul 15 19:22:51 2008 -0700
    10.3 @@ -38,7 +38,7 @@
    10.4  public class PackageUseWriter extends SubWriterHolderWriter {
    10.5  
    10.6      final PackageDoc pkgdoc;
    10.7 -    final SortedMap usingPackageToUsedClasses = new TreeMap();
    10.8 +    final SortedMap<String,Set<ClassDoc>> usingPackageToUsedClasses = new TreeMap<String,Set<ClassDoc>>();
    10.9  
   10.10      /**
   10.11       * Constructor.
   10.12 @@ -61,15 +61,15 @@
   10.13          ClassDoc[] content = pkgdoc.allClasses();
   10.14          for (int i = 0; i < content.length; ++i) {
   10.15              ClassDoc usedClass = content[i];
   10.16 -            Set usingClasses = (Set)mapper.classToClass.get(usedClass.qualifiedName());
   10.17 +            Set<ClassDoc> usingClasses = mapper.classToClass.get(usedClass.qualifiedName());
   10.18              if (usingClasses != null) {
   10.19                  for (Iterator it = usingClasses.iterator(); it.hasNext(); ) {
   10.20                      ClassDoc usingClass = (ClassDoc)it.next();
   10.21                      PackageDoc usingPackage = usingClass.containingPackage();
   10.22 -                    Set usedClasses = (Set)usingPackageToUsedClasses
   10.23 +                    Set<ClassDoc> usedClasses = usingPackageToUsedClasses
   10.24                          .get(usingPackage.name());
   10.25                      if (usedClasses == null) {
   10.26 -                        usedClasses = new TreeSet();
   10.27 +                        usedClasses = new TreeSet<ClassDoc>();
   10.28                          usingPackageToUsedClasses.put(Util.getPackageName(usingPackage),
   10.29                                                        usedClasses);
   10.30                      }
    11.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Tue Jul 15 09:50:36 2008 -0700
    11.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Tue Jul 15 19:22:51 2008 -0700
    11.3 @@ -120,12 +120,12 @@
    11.4      /**
    11.5       * The list of doc-file subdirectories to exclude
    11.6       */
    11.7 -    protected Set excludedDocFileDirs;
    11.8 +    protected Set<String> excludedDocFileDirs;
    11.9  
   11.10      /**
   11.11       * The list of qualifiers to exclude
   11.12       */
   11.13 -    protected Set excludedQualifiers;
   11.14 +    protected Set<String> excludedQualifiers;
   11.15  
   11.16      /**
   11.17       * The Root of the generated Program Structure from the Doclet API.
   11.18 @@ -255,8 +255,8 @@
   11.19          message =
   11.20              new MessageRetriever(this,
   11.21              "com.sun.tools.doclets.internal.toolkit.resources.doclets");
   11.22 -        excludedDocFileDirs = new HashSet();
   11.23 -        excludedQualifiers = new HashSet();
   11.24 +        excludedDocFileDirs = new HashSet<String>();
   11.25 +        excludedQualifiers = new HashSet<String>();
   11.26      }
   11.27  
   11.28      /**
   11.29 @@ -329,14 +329,14 @@
   11.30          DocErrorReporter reporter);
   11.31  
   11.32      private void initPackageArray() {
   11.33 -        Set set = new HashSet(Arrays.asList(root.specifiedPackages()));
   11.34 +        Set<PackageDoc> set = new HashSet<PackageDoc>(Arrays.asList(root.specifiedPackages()));
   11.35          ClassDoc[] classes = root.specifiedClasses();
   11.36          for (int i = 0; i < classes.length; i++) {
   11.37              set.add(classes[i].containingPackage());
   11.38          }
   11.39 -        ArrayList results = new ArrayList(set);
   11.40 +        ArrayList<PackageDoc> results = new ArrayList<PackageDoc>(set);
   11.41          Collections.sort(results);
   11.42 -        packages = (PackageDoc[]) results.toArray(new PackageDoc[] {});
   11.43 +        packages = results.toArray(new PackageDoc[] {});
   11.44      }
   11.45  
   11.46      /**
   11.47 @@ -345,7 +345,7 @@
   11.48       * @param options the two dimensional array of options.
   11.49       */
   11.50      public void setOptions(String[][] options) {
   11.51 -        LinkedHashSet customTagStrs = new LinkedHashSet();
   11.52 +        LinkedHashSet<String[]> customTagStrs = new LinkedHashSet<String[]>();
   11.53          for (int oi = 0; oi < options.length; ++oi) {
   11.54              String[] os = options[oi];
   11.55              String opt = os[0].toLowerCase();
   11.56 @@ -476,7 +476,7 @@
   11.57          }
   11.58      }
   11.59  
   11.60 -    private void addToSet(Set s, String str){
   11.61 +    private void addToSet(Set<String> s, String str){
   11.62          StringTokenizer st = new StringTokenizer(str, ":");
   11.63          String current;
   11.64          while(st.hasMoreTokens()){
   11.65 @@ -712,5 +712,5 @@
   11.66       *
   11.67       * @return the {@link java.util.Comparator} used to sort members.
   11.68       */
   11.69 -    public abstract Comparator getMemberComparator();
   11.70 +    public abstract Comparator<ProgramElementDoc> getMemberComparator();
   11.71  }
    12.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java	Tue Jul 15 09:50:36 2008 -0700
    12.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java	Tue Jul 15 19:22:51 2008 -0700
    12.3 @@ -79,7 +79,7 @@
    12.4       *                              something more than once.
    12.5       */
    12.6      public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName,
    12.7 -        Set WriteedPackageHeaders);
    12.8 +        Set<String> WriteedPackageHeaders);
    12.9  
   12.10      /**
   12.11       * Write the given package name.
    13.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    13.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    13.3 @@ -61,7 +61,7 @@
    13.4       * efficiency purposes.  We don't want to copy the
    13.5       * doc files multiple times for a single package.
    13.6       */
    13.7 -    protected static Set containingPackagesSeen;
    13.8 +    protected static Set<String> containingPackagesSeen;
    13.9  
   13.10      /**
   13.11       * True if we want to print debug output.
    14.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    14.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    14.3 @@ -84,7 +84,7 @@
    14.4          builder.annotationTypeDoc = annotationTypeDoc;
    14.5          builder.writer = writer;
    14.6          if(containingPackagesSeen == null) {
    14.7 -            containingPackagesSeen = new HashSet();
    14.8 +            containingPackagesSeen = new HashSet<String>();
    14.9          }
   14.10          return builder;
   14.11      }
    15.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    15.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    15.3 @@ -73,7 +73,7 @@
    15.4          builder.writer = writer;
    15.5          builder.visibleMemberMap = new VisibleMemberMap(classDoc,
    15.6              VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, configuration.nodeprecated);
    15.7 -        builder.members = new ArrayList(
    15.8 +        builder.members = new ArrayList<ProgramElementDoc>(
    15.9              builder.visibleMemberMap.getMembersFor(classDoc));
   15.10          if (configuration.getMemberComparator() != null) {
   15.11              Collections.sort(builder.members,
    16.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    16.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    16.3 @@ -62,7 +62,7 @@
    16.4      /**
    16.5       * The list of members being documented.
    16.6       */
    16.7 -    protected List members;
    16.8 +    protected List<ProgramElementDoc> members;
    16.9  
   16.10      /**
   16.11       * The index of the current member that is being documented at this point
   16.12 @@ -97,7 +97,7 @@
   16.13          builder.writer = writer;
   16.14          builder.visibleMemberMap = new VisibleMemberMap(classDoc,
   16.15              VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, configuration.nodeprecated);
   16.16 -        builder.members = new ArrayList(
   16.17 +        builder.members = new ArrayList<ProgramElementDoc>(
   16.18              builder.visibleMemberMap.getMembersFor(classDoc));
   16.19          if (configuration.getMemberComparator() != null) {
   16.20              Collections.sort(builder.members,
    17.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    17.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    17.3 @@ -100,7 +100,7 @@
    17.4              Util.setEnumDocumentation(configuration, classDoc);
    17.5          }
    17.6          if(containingPackagesSeen == null) {
    17.7 -            containingPackagesSeen = new HashSet();
    17.8 +            containingPackagesSeen = new HashSet<String>();
    17.9          }
   17.10          return builder;
   17.11      }
    18.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    18.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    18.3 @@ -63,12 +63,12 @@
    18.4      /**
    18.5       * The set of ClassDocs that have constant fields.
    18.6       */
    18.7 -    protected Set classDocsWithConstFields;
    18.8 +    protected Set<ClassDoc> classDocsWithConstFields;
    18.9  
   18.10      /**
   18.11       * The set of printed package headers.
   18.12       */
   18.13 -    protected Set printedPackageHeaders;
   18.14 +    protected Set<String> printedPackageHeaders;
   18.15  
   18.16      /**
   18.17       * The current package being documented.
   18.18 @@ -102,7 +102,7 @@
   18.19          ConstantsSummaryBuilder builder = new ConstantsSummaryBuilder(
   18.20              configuration);
   18.21          builder.writer = writer;
   18.22 -        builder.classDocsWithConstFields = new HashSet();
   18.23 +        builder.classDocsWithConstFields = new HashSet<ClassDoc>();
   18.24          return builder;
   18.25      }
   18.26  
   18.27 @@ -169,7 +169,7 @@
   18.28      public void buildContents() {
   18.29          writer.writeContentsHeader();
   18.30          PackageDoc[] packages = configuration.packages;
   18.31 -        printedPackageHeaders = new HashSet();
   18.32 +        printedPackageHeaders = new HashSet<String>();
   18.33          for (int i = 0; i < packages.length; i++) {
   18.34              if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) {
   18.35                  writer.writeLinkToPackageContent(packages[i],
   18.36 @@ -188,7 +188,7 @@
   18.37       */
   18.38      public void buildConstantSummaries(List elements) {
   18.39          PackageDoc[] packages = configuration.packages;
   18.40 -        printedPackageHeaders = new HashSet();
   18.41 +        printedPackageHeaders = new HashSet<String>();
   18.42          for (int i = 0; i < packages.length; i++) {
   18.43              if (hasConstantField(packages[i])) {
   18.44                  currentPackage = packages[i];
   18.45 @@ -315,7 +315,7 @@
   18.46       * @param pkgname the name of the package to check.
   18.47       */
   18.48      private boolean hasPrintedPackageIndex(String pkgname) {
   18.49 -        String[] list = (String[])printedPackageHeaders.toArray(new String[] {});
   18.50 +        String[] list = printedPackageHeaders.toArray(new String[] {});
   18.51          for (int i = 0; i < list.length; i++) {
   18.52              if (pkgname.startsWith(list[i])) {
   18.53                  return true;
   18.54 @@ -363,7 +363,7 @@
   18.55           * Builds the table of constants for a given class.
   18.56           */
   18.57          protected void buildMembersSummary() {
   18.58 -            List members = new ArrayList(members());
   18.59 +            List<FieldDoc> members = new ArrayList<FieldDoc>(members());
   18.60              if (members.size() > 0) {
   18.61                  Collections.sort(members);
   18.62                  writer.writeConstantMembers(classdoc, members);
   18.63 @@ -375,17 +375,17 @@
   18.64           * @param cd the classdoc to examine.
   18.65           * @return the list of visible constant fields for the given classdoc.
   18.66           */
   18.67 -        protected List members() {
   18.68 -            List l = visibleMemberMapFields.getLeafClassMembers(configuration);
   18.69 +        protected List<FieldDoc> members() {
   18.70 +            List<ProgramElementDoc> l = visibleMemberMapFields.getLeafClassMembers(configuration);
   18.71              l.addAll(visibleMemberMapEnumConst.getLeafClassMembers(configuration));
   18.72 -            Iterator iter;
   18.73 +            Iterator<ProgramElementDoc> iter;
   18.74  
   18.75              if(l != null){
   18.76                  iter = l.iterator();
   18.77              } else {
   18.78                  return null;
   18.79              }
   18.80 -            List inclList = new LinkedList();
   18.81 +            List<FieldDoc> inclList = new LinkedList<FieldDoc>();
   18.82              FieldDoc member;
   18.83              while(iter.hasNext()){
   18.84                  member = (FieldDoc)iter.next();
    19.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    19.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    19.3 @@ -72,7 +72,7 @@
    19.4          /**
    19.5           * The constructors being documented.
    19.6           */
    19.7 -        private List constructors;
    19.8 +        private List<ProgramElementDoc> constructors;
    19.9  
   19.10          /**
   19.11           * Construct a new ConstructorBuilder.
   19.12 @@ -104,12 +104,10 @@
   19.13                                  VisibleMemberMap.CONSTRUCTORS,
   19.14                                  configuration.nodeprecated);
   19.15                  builder.constructors =
   19.16 -                        new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc));
   19.17 +                        new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
   19.18                  for (int i = 0; i < builder.constructors.size(); i++) {
   19.19 -                        if (((ProgramElementDoc) (builder.constructors.get(i)))
   19.20 -                                .isProtected()
   19.21 -                                || ((ProgramElementDoc) (builder.constructors.get(i)))
   19.22 -                                        .isPrivate()) {
   19.23 +                        if (builder.constructors.get(i).isProtected()
   19.24 +                                || builder.constructors.get(i).isPrivate()) {
   19.25                                  writer.setFoundNonPubConstructor(true);
   19.26                          }
   19.27                  }
    20.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    20.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    20.3 @@ -61,7 +61,7 @@
    20.4          /**
    20.5           * The list of enum constants being documented.
    20.6           */
    20.7 -        private List enumConstants;
    20.8 +        private List<ProgramElementDoc> enumConstants;
    20.9  
   20.10          /**
   20.11           * The index of the current enum constant that is being documented at this point
   20.12 @@ -99,7 +99,7 @@
   20.13                                  VisibleMemberMap.ENUM_CONSTANTS,
   20.14                                  configuration.nodeprecated);
   20.15                  builder.enumConstants =
   20.16 -                        new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc));
   20.17 +                        new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getMembersFor(classDoc));
   20.18                  if (configuration.getMemberComparator() != null) {
   20.19                          Collections.sort(
   20.20                                  builder.enumConstants,
    21.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    21.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    21.3 @@ -61,7 +61,7 @@
    21.4          /**
    21.5           * The list of fields being documented.
    21.6           */
    21.7 -        private List fields;
    21.8 +        private List<ProgramElementDoc> fields;
    21.9  
   21.10          /**
   21.11           * The index of the current field that is being documented at this point
   21.12 @@ -99,8 +99,8 @@
   21.13                                  VisibleMemberMap.FIELDS,
   21.14                                  configuration.nodeprecated);
   21.15                  builder.fields =
   21.16 -                        new ArrayList(builder.visibleMemberMap.getLeafClassMembers(
   21.17 -                configuration));
   21.18 +                        new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
   21.19 +                            configuration));
   21.20                  if (configuration.getMemberComparator() != null) {
   21.21                          Collections.sort(
   21.22                                  builder.fields,
    22.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java	Tue Jul 15 09:50:36 2008 -0700
    22.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java	Tue Jul 15 19:22:51 2008 -0700
    22.3 @@ -45,7 +45,7 @@
    22.4      /**
    22.5       * The map of XML elements that have been parsed.
    22.6       */
    22.7 -    private Map xmlElementsMap;
    22.8 +    private Map<String,List<Object>> xmlElementsMap;
    22.9  
   22.10      private Configuration configuration;
   22.11      private static LayoutParser instance;
   22.12 @@ -56,7 +56,7 @@
   22.13       * This class is a singleton.
   22.14       */
   22.15      private LayoutParser(Configuration configuration) {
   22.16 -        xmlElementsMap = new HashMap();
   22.17 +        xmlElementsMap = new HashMap<String,List<Object>>();
   22.18          this.configuration = configuration;
   22.19      }
   22.20  
   22.21 @@ -83,7 +83,7 @@
   22.22              return (List) xmlElementsMap.get(root);
   22.23          }
   22.24          try {
   22.25 -            List xmlElements = new ArrayList();
   22.26 +            List<Object> xmlElements = new ArrayList<Object>();
   22.27              xmlElementsMap.put(root, xmlElements);
   22.28              currentRoot = root;
   22.29              isParsing = false;
   22.30 @@ -106,7 +106,7 @@
   22.31      throws SAXException {
   22.32          if (isParsing || qName.equals(currentRoot)) {
   22.33              isParsing = true;
   22.34 -            List xmlElements = (List) xmlElementsMap.get(currentRoot);
   22.35 +            List<Object> xmlElements = xmlElementsMap.get(currentRoot);
   22.36              xmlElements.add(qName);
   22.37          }
   22.38      }
   22.39 @@ -120,11 +120,11 @@
   22.40              isParsing = false;
   22.41              return;
   22.42          }
   22.43 -        List xmlElements = (List) xmlElementsMap.get(currentRoot);
   22.44 +        List<Object> xmlElements = xmlElementsMap.get(currentRoot);
   22.45          if (xmlElements.get(xmlElements.size()-1).equals(qName)) {
   22.46              return;
   22.47          } else {
   22.48 -            List subElements = new ArrayList();
   22.49 +            List<Object> subElements = new ArrayList<Object>();
   22.50              int targetIndex = xmlElements.indexOf(qName);
   22.51              int size = xmlElements.size();
   22.52              for (int i = targetIndex; i < size; i++) {
    23.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    23.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    23.3 @@ -306,13 +306,13 @@
    23.4           */
    23.5          private void buildSummary(MemberSummaryWriter writer,
    23.6              VisibleMemberMap visibleMemberMap) {
    23.7 -        List members = new ArrayList(visibleMemberMap.getLeafClassMembers(
    23.8 +        List<ProgramElementDoc> members = new ArrayList<ProgramElementDoc>(visibleMemberMap.getLeafClassMembers(
    23.9              configuration));
   23.10          if (members.size() > 0) {
   23.11              Collections.sort(members);
   23.12              writer.writeMemberSummaryHeader(classDoc);
   23.13              for (int i = 0; i < members.size(); i++) {
   23.14 -                ProgramElementDoc member = (ProgramElementDoc) members.get(i);
   23.15 +                ProgramElementDoc member = members.get(i);
   23.16                  Tag[] firstSentenceTags = member.firstSentenceTags();
   23.17                  if (member instanceof MethodDoc && firstSentenceTags.length == 0) {
   23.18                      //Inherit comments from overriden or implemented method if
   23.19 @@ -349,7 +349,7 @@
   23.20              if (inhclass == classDoc) {
   23.21                  continue;
   23.22              }
   23.23 -            List inhmembers = visibleMemberMap.getMembersFor(inhclass);
   23.24 +            List<ProgramElementDoc> inhmembers = visibleMemberMap.getMembersFor(inhclass);
   23.25              if (inhmembers.size() > 0) {
   23.26                  Collections.sort(inhmembers);
   23.27                  writer.writeInheritedMemberSummaryHeader(inhclass);
   23.28 @@ -358,7 +358,7 @@
   23.29                          inhclass.isPackagePrivate() &&
   23.30                              ! Util.isLinkable(inhclass, configuration) ?
   23.31                              classDoc : inhclass,
   23.32 -                        (ProgramElementDoc) inhmembers.get(j),
   23.33 +                        inhmembers.get(j),
   23.34                          j == 0,
   23.35                          j == inhmembers.size() - 1);
   23.36                  }
    24.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    24.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    24.3 @@ -66,7 +66,7 @@
    24.4          /**
    24.5           * The methods being documented.
    24.6           */
    24.7 -        private List methods;
    24.8 +        private List<ProgramElementDoc> methods;
    24.9  
   24.10          private MethodBuilder(Configuration configuration) {
   24.11                  super(configuration);
   24.12 @@ -94,7 +94,7 @@
   24.13                                  VisibleMemberMap.METHODS,
   24.14                                  configuration.nodeprecated);
   24.15                  builder.methods =
   24.16 -                        new ArrayList(builder.visibleMemberMap.getLeafClassMembers(
   24.17 +                        new ArrayList<ProgramElementDoc>(builder.visibleMemberMap.getLeafClassMembers(
   24.18                  configuration));
   24.19                  if (configuration.getMemberComparator() != null) {
   24.20                          Collections.sort(
    25.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java	Tue Jul 15 09:50:36 2008 -0700
    25.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java	Tue Jul 15 19:22:51 2008 -0700
    25.3 @@ -26,6 +26,7 @@
    25.4  
    25.5  import java.util.Map;
    25.6  import com.sun.javadoc.Tag;
    25.7 +import com.sun.tools.doclets.Taglet;
    25.8  
    25.9  /**
   25.10   * An inline Taglet used to denote literal code fragments.
   25.11 @@ -47,7 +48,7 @@
   25.12  
   25.13          private static final String NAME = "code";
   25.14  
   25.15 -        public static void register(Map map) {
   25.16 +        public static void register(Map<String, Taglet> map) {
   25.17                  map.remove(NAME);
   25.18                  map.put(NAME, new CodeTaglet());
   25.19          }
    26.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java	Tue Jul 15 09:50:36 2008 -0700
    26.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java	Tue Jul 15 19:22:51 2008 -0700
    26.3 @@ -46,7 +46,7 @@
    26.4  
    26.5      private static final String NAME = "literal";
    26.6  
    26.7 -    public static void register(Map map) {
    26.8 +    public static void register(Map<String,Taglet> map) {
    26.9             map.remove(NAME);
   26.10             map.put(NAME, new LiteralTaglet());
   26.11      }
    27.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java	Tue Jul 15 09:50:36 2008 -0700
    27.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java	Tue Jul 15 19:22:51 2008 -0700
    27.3 @@ -56,11 +56,11 @@
    27.4       *               check.
    27.5       * @return a name-rank number map.
    27.6       */
    27.7 -    private static Map getRankMap(Object[] params){
    27.8 +    private static Map<String,String> getRankMap(Object[] params){
    27.9          if (params == null) {
   27.10              return null;
   27.11          }
   27.12 -        HashMap result = new HashMap();
   27.13 +        HashMap<String,String> result = new HashMap<String,String>();
   27.14          for (int i = 0; i < params.length; i++) {
   27.15              String name = params[i] instanceof Parameter ?
   27.16                  ((Parameter) params[i]).name() :
   27.17 @@ -192,7 +192,7 @@
   27.18      private TagletOutput getTagletOutput(boolean isNonTypeParams, Doc holder,
   27.19              TagletWriter writer, Object[] formalParameters, ParamTag[] paramTags) {
   27.20          TagletOutput result = writer.getOutputInstance();
   27.21 -        Set alreadyDocumented = new HashSet();
   27.22 +        Set<String> alreadyDocumented = new HashSet<String>();
   27.23          if (paramTags.length > 0) {
   27.24              result.appendOutput(
   27.25                  processParamTags(isNonTypeParams, paramTags,
   27.26 @@ -214,7 +214,7 @@
   27.27       */
   27.28      private TagletOutput getInheritedTagletOutput(boolean isNonTypeParams, Doc holder,
   27.29              TagletWriter writer, Object[] formalParameters,
   27.30 -            Set alreadyDocumented) {
   27.31 +            Set<String> alreadyDocumented) {
   27.32          TagletOutput result = writer.getOutputInstance();
   27.33          if ((! alreadyDocumented.contains(null)) &&
   27.34                  holder instanceof MethodDoc) {
   27.35 @@ -263,7 +263,7 @@
   27.36       */
   27.37      private TagletOutput processParamTags(boolean isNonTypeParams,
   27.38              ParamTag[] paramTags, Map rankMap, TagletWriter writer,
   27.39 -            Set alreadyDocumented) {
   27.40 +            Set<String> alreadyDocumented) {
   27.41          TagletOutput result = writer.getOutputInstance();
   27.42          if (paramTags.length > 0) {
   27.43              for (int i = 0; i < paramTags.length; ++i) {
    28.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Tue Jul 15 09:50:36 2008 -0700
    28.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Tue Jul 15 19:22:51 2008 -0700
    28.3 @@ -61,7 +61,7 @@
    28.4      /**
    28.5       * The map of custom tags.
    28.6       */
    28.7 -    private LinkedHashMap customTags;
    28.8 +    private LinkedHashMap<String,Taglet> customTags;
    28.9  
   28.10      /**
   28.11       * The array of custom tags that can appear in packages.
   28.12 @@ -111,31 +111,31 @@
   28.13      /**
   28.14       * Keep track of standard tags.
   28.15       */
   28.16 -    private Set standardTags;
   28.17 +    private Set<String> standardTags;
   28.18  
   28.19      /**
   28.20       * Keep track of standard tags in lowercase to compare for better
   28.21       * error messages when a tag like @docRoot is mistakenly spelled
   28.22       * lowercase @docroot.
   28.23       */
   28.24 -    private Set standardTagsLowercase;
   28.25 +    private Set<String> standardTagsLowercase;
   28.26  
   28.27      /**
   28.28       * Keep track of overriden standard tags.
   28.29       */
   28.30 -    private Set overridenStandardTags;
   28.31 +    private Set<String> overridenStandardTags;
   28.32  
   28.33      /**
   28.34       * Keep track of the tags that may conflict
   28.35       * with standard tags in the future (any custom tag without
   28.36       * a period in its name).
   28.37       */
   28.38 -    private Set potentiallyConflictingTags;
   28.39 +    private Set<String> potentiallyConflictingTags;
   28.40  
   28.41      /**
   28.42       * The set of unseen custom tags.
   28.43       */
   28.44 -    private Set unseenCustomTags;
   28.45 +    private Set<String> unseenCustomTags;
   28.46  
   28.47      /**
   28.48       * True if we do not want to use @since tags.
   28.49 @@ -161,12 +161,12 @@
   28.50       */
   28.51      public TagletManager(boolean nosince, boolean showversion,
   28.52                           boolean showauthor, MessageRetriever message){
   28.53 -        overridenStandardTags = new HashSet();
   28.54 -        potentiallyConflictingTags = new HashSet();
   28.55 -        standardTags = new HashSet();
   28.56 -        standardTagsLowercase = new HashSet();
   28.57 -        unseenCustomTags = new HashSet();
   28.58 -        customTags = new LinkedHashMap();
   28.59 +        overridenStandardTags = new HashSet<String>();
   28.60 +        potentiallyConflictingTags = new HashSet<String>();
   28.61 +        standardTags = new HashSet<String>();
   28.62 +        standardTagsLowercase = new HashSet<String>();
   28.63 +        unseenCustomTags = new HashSet<String>();
   28.64 +        customTags = new LinkedHashMap<String,Taglet>();
   28.65          this.nosince = nosince;
   28.66          this.showversion = showversion;
   28.67          this.showauthor = showauthor;
   28.68 @@ -201,7 +201,7 @@
   28.69       */
   28.70      public void addCustomTag(String classname, String tagletPath) {
   28.71          try {
   28.72 -            Class customTagClass = null;
   28.73 +            Class<?> customTagClass = null;
   28.74              // construct class loader
   28.75              String cpString = null;   // make sure env.class.path defaults to dot
   28.76  
   28.77 @@ -219,7 +219,7 @@
   28.78              meth.invoke(null, new Object[] {customTags});
   28.79              list = customTags.values().toArray();
   28.80              Object newLastTag = (list != null&& list.length > 0)
   28.81 -                ? (Object) list[list.length-1] : null;
   28.82 +                ? list[list.length-1] : null;
   28.83              if (lastTag != newLastTag) {
   28.84                  //New taglets must always be added to the end of the LinkedHashMap.
   28.85                  //If the current and previous last taglet are not equal, that
   28.86 @@ -315,7 +315,7 @@
   28.87          if (tagName == null || locations == null) {
   28.88              return;
   28.89          }
   28.90 -        Taglet tag = (Taglet) customTags.get(tagName);
   28.91 +        Taglet tag = customTags.get(tagName);
   28.92          locations = locations.toLowerCase();
   28.93          if (tag == null || header != null) {
   28.94              customTags.remove(tagName);
   28.95 @@ -396,7 +396,7 @@
   28.96                  }
   28.97              }
   28.98              //Check if this tag is being used in the wrong location.
   28.99 -            if((taglet = (Taglet) customTags.get(name)) != null) {
  28.100 +            if ((taglet = customTags.get(name)) != null) {
  28.101                  if (areInlineTags && ! taglet.isInlineTag()) {
  28.102                      printTagMisuseWarn(taglet, tags[i], "inline");
  28.103                  }
  28.104 @@ -425,7 +425,7 @@
  28.105       * @param holderType the type of documentation that the misused tag was found in.
  28.106       */
  28.107      private void printTagMisuseWarn(Taglet taglet, Tag tag, String holderType) {
  28.108 -        Set locationsSet = new LinkedHashSet();
  28.109 +        Set<String> locationsSet = new LinkedHashSet<String>();
  28.110          if (taglet.inOverview()) {
  28.111              locationsSet.add("overview");
  28.112          }
  28.113 @@ -447,7 +447,7 @@
  28.114          if (taglet.isInlineTag()) {
  28.115              locationsSet.add("inline text");
  28.116          }
  28.117 -        String[] locations = (String[]) locationsSet.toArray(new String[]{});
  28.118 +        String[] locations = locationsSet.toArray(new String[]{});
  28.119          if (locations == null || locations.length == 0) {
  28.120              //This known tag is excluded.
  28.121              return;
  28.122 @@ -592,17 +592,17 @@
  28.123       * Initialize the custom tag arrays.
  28.124       */
  28.125      private void initCustomTagArrays() {
  28.126 -        Iterator it = customTags.values().iterator();
  28.127 -        ArrayList pTags = new ArrayList(customTags.size());
  28.128 -        ArrayList tTags = new ArrayList(customTags.size());
  28.129 -        ArrayList fTags = new ArrayList(customTags.size());
  28.130 -        ArrayList cTags = new ArrayList(customTags.size());
  28.131 -        ArrayList mTags = new ArrayList(customTags.size());
  28.132 -        ArrayList iTags = new ArrayList(customTags.size());
  28.133 -        ArrayList oTags = new ArrayList(customTags.size());
  28.134 +        Iterator<Taglet> it = customTags.values().iterator();
  28.135 +        ArrayList<Taglet> pTags = new ArrayList<Taglet>(customTags.size());
  28.136 +        ArrayList<Taglet> tTags = new ArrayList<Taglet>(customTags.size());
  28.137 +        ArrayList<Taglet> fTags = new ArrayList<Taglet>(customTags.size());
  28.138 +        ArrayList<Taglet> cTags = new ArrayList<Taglet>(customTags.size());
  28.139 +        ArrayList<Taglet> mTags = new ArrayList<Taglet>(customTags.size());
  28.140 +        ArrayList<Taglet> iTags = new ArrayList<Taglet>(customTags.size());
  28.141 +        ArrayList<Taglet> oTags = new ArrayList<Taglet>(customTags.size());
  28.142          Taglet current;
  28.143          while (it.hasNext()) {
  28.144 -            current = (Taglet) it.next();
  28.145 +            current = it.next();
  28.146              if (current.inPackage() && !current.isInlineTag()) {
  28.147                  pTags.add(current);
  28.148              }
  28.149 @@ -625,20 +625,20 @@
  28.150                  oTags.add(current);
  28.151              }
  28.152          }
  28.153 -        packageTags =  (Taglet[]) pTags.toArray(new Taglet[] {});
  28.154 -        typeTags =  (Taglet[]) tTags.toArray(new Taglet[] {});
  28.155 -        fieldTags =  (Taglet[]) fTags.toArray(new Taglet[] {});
  28.156 -        constructorTags =  (Taglet[]) cTags.toArray(new Taglet[] {});
  28.157 -        methodTags =  (Taglet[]) mTags.toArray(new Taglet[] {});
  28.158 -        overviewTags = (Taglet[]) oTags.toArray(new Taglet[] {});
  28.159 -        inlineTags =  (Taglet[]) iTags.toArray(new Taglet[] {});
  28.160 +        packageTags = pTags.toArray(new Taglet[] {});
  28.161 +        typeTags = tTags.toArray(new Taglet[] {});
  28.162 +        fieldTags = fTags.toArray(new Taglet[] {});
  28.163 +        constructorTags = cTags.toArray(new Taglet[] {});
  28.164 +        methodTags = mTags.toArray(new Taglet[] {});
  28.165 +        overviewTags = oTags.toArray(new Taglet[] {});
  28.166 +        inlineTags = iTags.toArray(new Taglet[] {});
  28.167  
  28.168          //Init the serialized form tags
  28.169          serializedFormTags = new Taglet[4];
  28.170 -        serializedFormTags[0] = (Taglet) customTags.get("serialData");
  28.171 -        serializedFormTags[1] = (Taglet) customTags.get("throws");
  28.172 -        serializedFormTags[2] = (Taglet) customTags.get("since");
  28.173 -        serializedFormTags[3] = (Taglet) customTags.get("see");
  28.174 +        serializedFormTags[0] = customTags.get("serialData");
  28.175 +        serializedFormTags[1] = customTags.get("throws");
  28.176 +        serializedFormTags[2] = customTags.get("since");
  28.177 +        serializedFormTags[3] = customTags.get("see");
  28.178      }
  28.179  
  28.180      /**
  28.181 @@ -726,10 +726,9 @@
  28.182          printReportHelper("doclet.Notice_taglet_unseen", unseenCustomTags);
  28.183      }
  28.184  
  28.185 -    private void printReportHelper(String noticeKey, Set names) {
  28.186 +    private void printReportHelper(String noticeKey, Set<String> names) {
  28.187          if (names.size() > 0) {
  28.188 -            String[] namesArray =
  28.189 -                (String[]) names.toArray(new String[] {});
  28.190 +            String[] namesArray = names.toArray(new String[] {});
  28.191              String result = " ";
  28.192              for (int i = 0; i < namesArray.length; i++) {
  28.193                  result += "@" + namesArray[i];
  28.194 @@ -751,9 +750,9 @@
  28.195       */
  28.196      public Taglet getTaglet(String name) {
  28.197          if (name.indexOf("@") == 0) {
  28.198 -            return (Taglet) customTags.get(name.substring(1));
  28.199 +            return customTags.get(name.substring(1));
  28.200          } else {
  28.201 -            return (Taglet) customTags.get(name);
  28.202 +            return customTags.get(name);
  28.203          }
  28.204  
  28.205      }
    29.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java	Tue Jul 15 09:50:36 2008 -0700
    29.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java	Tue Jul 15 19:22:51 2008 -0700
    29.3 @@ -82,7 +82,7 @@
    29.4       * Add links for exceptions that are declared but not documented.
    29.5       */
    29.6      private TagletOutput linkToUndocumentedDeclaredExceptions(
    29.7 -            Type[] declaredExceptionTypes, Set alreadyDocumented,
    29.8 +            Type[] declaredExceptionTypes, Set<String> alreadyDocumented,
    29.9              TagletWriter writer) {
   29.10          TagletOutput result = writer.getOutputInstance();
   29.11          //Add links to the exceptions declared but not documented.
   29.12 @@ -107,11 +107,11 @@
   29.13       * documented.
   29.14       */
   29.15      private TagletOutput inheritThrowsDocumentation(Doc holder,
   29.16 -            Type[] declaredExceptionTypes, Set alreadyDocumented,
   29.17 +            Type[] declaredExceptionTypes, Set<String> alreadyDocumented,
   29.18              TagletWriter writer) {
   29.19          TagletOutput result = writer.getOutputInstance();
   29.20          if (holder instanceof MethodDoc) {
   29.21 -            Set declaredExceptionTags = new LinkedHashSet();
   29.22 +            Set<Tag> declaredExceptionTags = new LinkedHashSet<Tag>();
   29.23              for (int j = 0; j < declaredExceptionTypes.length; j++) {
   29.24                  DocFinder.Output inheritedDoc =
   29.25                      DocFinder.search(new DocFinder.Input((MethodDoc) holder, this,
   29.26 @@ -124,7 +124,7 @@
   29.27                  declaredExceptionTags.addAll(inheritedDoc.tagList);
   29.28              }
   29.29              result.appendOutput(throwsTagsOutput(
   29.30 -                (ThrowsTag[]) declaredExceptionTags.toArray(new ThrowsTag[] {}),
   29.31 +                declaredExceptionTags.toArray(new ThrowsTag[] {}),
   29.32                  writer, alreadyDocumented, false));
   29.33          }
   29.34          return result;
   29.35 @@ -137,7 +137,7 @@
   29.36          ExecutableMemberDoc execHolder = (ExecutableMemberDoc) holder;
   29.37          ThrowsTag[] tags = execHolder.throwsTags();
   29.38          TagletOutput result = writer.getOutputInstance();
   29.39 -        HashSet alreadyDocumented = new HashSet();
   29.40 +        HashSet<String> alreadyDocumented = new HashSet<String>();
   29.41          if (tags.length > 0) {
   29.42              result.appendOutput(throwsTagsOutput(
   29.43                  execHolder.throwsTags(), writer, alreadyDocumented, true));
   29.44 @@ -161,7 +161,7 @@
   29.45       * @return the TagletOutput representation of this <code>Tag</code>.
   29.46       */
   29.47      protected TagletOutput throwsTagsOutput(ThrowsTag[] throwTags,
   29.48 -        TagletWriter writer, Set alreadyDocumented, boolean allowDups) {
   29.49 +        TagletWriter writer, Set<String> alreadyDocumented, boolean allowDups) {
   29.50          TagletOutput result = writer.getOutputInstance();
   29.51          if (throwTags.length > 0) {
   29.52              for (int i = 0; i < throwTags.length; ++i) {
    30.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java	Tue Jul 15 09:50:36 2008 -0700
    30.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java	Tue Jul 15 19:22:51 2008 -0700
    30.3 @@ -49,44 +49,44 @@
    30.4        * Stores the set of packages that the classes specified on the command line
    30.5        * belong to.  Note that the default package is "".
    30.6        */
    30.7 -     private Set packageSet;
    30.8 +     private Set<String> packageSet;
    30.9  
   30.10  
   30.11       /**
   30.12        * Stores all classes for each package
   30.13        */
   30.14 -     private Map allClasses;
   30.15 +     private Map<String,Set<ClassDoc>> allClasses;
   30.16  
   30.17       /**
   30.18        * Stores ordinary classes (excluding Exceptions and Errors) for each
   30.19        * package
   30.20        */
   30.21 -     private Map ordinaryClasses;
   30.22 +     private Map<String,Set<ClassDoc>> ordinaryClasses;
   30.23  
   30.24       /**
   30.25        * Stores exceptions for each package
   30.26        */
   30.27 -     private Map exceptions;
   30.28 +     private Map<String,Set<ClassDoc>> exceptions;
   30.29  
   30.30      /**
   30.31       * Stores enums for each package.
   30.32       */
   30.33 -    private Map enums;
   30.34 +    private Map<String,Set<ClassDoc>> enums;
   30.35  
   30.36      /**
   30.37       * Stores annotation types for each package.
   30.38       */
   30.39 -    private Map annotationTypes;
   30.40 +    private Map<String,Set<ClassDoc>> annotationTypes;
   30.41  
   30.42       /**
   30.43        * Stores errors for each package
   30.44        */
   30.45 -     private Map errors;
   30.46 +     private Map<String,Set<ClassDoc>> errors;
   30.47  
   30.48       /**
   30.49        * Stores interfaces for each package
   30.50        */
   30.51 -     private Map interfaces;
   30.52 +     private Map<String,Set<ClassDoc>> interfaces;
   30.53  
   30.54       /**
   30.55        * Construct a new ClassDocCatalog.
   30.56 @@ -109,14 +109,14 @@
   30.57       }
   30.58  
   30.59       private void init() {
   30.60 -         allClasses = new HashMap();
   30.61 -         ordinaryClasses = new HashMap();
   30.62 -         exceptions = new HashMap();
   30.63 -         enums = new HashMap();
   30.64 -         annotationTypes = new HashMap();
   30.65 -         errors = new HashMap();
   30.66 -         interfaces = new HashMap();
   30.67 -         packageSet = new HashSet();
   30.68 +         allClasses = new HashMap<String,Set<ClassDoc>>();
   30.69 +         ordinaryClasses = new HashMap<String,Set<ClassDoc>>();
   30.70 +         exceptions = new HashMap<String,Set<ClassDoc>>();
   30.71 +         enums = new HashMap<String,Set<ClassDoc>>();
   30.72 +         annotationTypes = new HashMap<String,Set<ClassDoc>>();
   30.73 +         errors = new HashMap<String,Set<ClassDoc>>();
   30.74 +         interfaces = new HashMap<String,Set<ClassDoc>>();
   30.75 +         packageSet = new HashSet<String>();
   30.76       }
   30.77  
   30.78       /**
   30.79 @@ -148,7 +148,7 @@
   30.80         * @param classdoc the ClassDoc to add to the catelog.
   30.81         * @param map the Map to add the ClassDoc to.
   30.82         */
   30.83 -      private void addClass(ClassDoc classdoc, Map map) {
   30.84 +      private void addClass(ClassDoc classdoc, Map<String,Set<ClassDoc>> map) {
   30.85  
   30.86            PackageDoc pkg = classdoc.containingPackage();
   30.87            if (pkg.isIncluded()) {
   30.88 @@ -157,22 +157,22 @@
   30.89                return;
   30.90            }
   30.91            String key = Util.getPackageName(pkg);
   30.92 -          Set s = (Set) map.get(key);
   30.93 +          Set<ClassDoc> s = map.get(key);
   30.94            if (s == null) {
   30.95                packageSet.add(key);
   30.96 -              s = new HashSet();
   30.97 +              s = new HashSet<ClassDoc>();
   30.98            }
   30.99            s.add(classdoc);
  30.100            map.put(key, s);
  30.101  
  30.102        }
  30.103  
  30.104 -      private ClassDoc[] getArray(Map m, String key) {
  30.105 -          Set s = (Set) m.get(key);
  30.106 +      private ClassDoc[] getArray(Map<String,Set<ClassDoc>> m, String key) {
  30.107 +          Set<ClassDoc> s = m.get(key);
  30.108            if (s == null) {
  30.109                return new ClassDoc[] {};
  30.110            } else {
  30.111 -              return (ClassDoc[]) s.toArray(new ClassDoc[] {});
  30.112 +              return s.toArray(new ClassDoc[] {});
  30.113            }
  30.114        }
  30.115  
  30.116 @@ -202,7 +202,7 @@
  30.117        * ClassDocs for.
  30.118        */
  30.119       public String[] packageNames() {
  30.120 -         return (String[]) packageSet.toArray(new String[] {});
  30.121 +         return packageSet.toArray(new String[] {});
  30.122       }
  30.123  
  30.124       /**
    31.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java	Tue Jul 15 09:50:36 2008 -0700
    31.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java	Tue Jul 15 19:22:51 2008 -0700
    31.3 @@ -49,35 +49,35 @@
    31.4       * List of baseclasses. Contains only java.lang.Object. Can be used to get
    31.5       * the mapped listing of sub-classes.
    31.6       */
    31.7 -    private List baseclasses = new ArrayList();
    31.8 +    private List<ClassDoc> baseclasses = new ArrayList<ClassDoc>();
    31.9  
   31.10      /**
   31.11      * Mapping for each Class with their SubClasses
   31.12      */
   31.13 -    private Map subclasses = new HashMap();
   31.14 +    private Map<ClassDoc,List<ClassDoc>> subclasses = new HashMap<ClassDoc,List<ClassDoc>>();
   31.15  
   31.16      /**
   31.17       * List of base-interfaces. Contains list of all the interfaces who do not
   31.18       * have super-interfaces. Can be used to get the mapped listing of
   31.19       * sub-interfaces.
   31.20       */
   31.21 -    private List baseinterfaces = new ArrayList();
   31.22 +    private List<ClassDoc> baseinterfaces = new ArrayList<ClassDoc>();
   31.23  
   31.24      /**
   31.25      * Mapping for each Interface with their SubInterfaces
   31.26      */
   31.27 -    private Map subinterfaces = new HashMap();
   31.28 +    private Map<ClassDoc,List<ClassDoc>> subinterfaces = new HashMap<ClassDoc,List<ClassDoc>>();
   31.29  
   31.30 -    private List baseEnums = new ArrayList();
   31.31 -    private Map subEnums = new HashMap();
   31.32 +    private List<ClassDoc> baseEnums = new ArrayList<ClassDoc>();
   31.33 +    private Map<ClassDoc,List<ClassDoc>> subEnums = new HashMap<ClassDoc,List<ClassDoc>>();
   31.34  
   31.35 -    private List baseAnnotationTypes = new ArrayList();
   31.36 -    private Map subAnnotationTypes = new HashMap();
   31.37 +    private List<ClassDoc> baseAnnotationTypes = new ArrayList<ClassDoc>();
   31.38 +    private Map<ClassDoc,List<ClassDoc>> subAnnotationTypes = new HashMap<ClassDoc,List<ClassDoc>>();
   31.39  
   31.40      /**
   31.41      * Mapping for each Interface with classes who implement it.
   31.42      */
   31.43 -    private Map implementingclasses = new HashMap();
   31.44 +    private Map<ClassDoc,List<ClassDoc>> implementingclasses = new HashMap<ClassDoc,List<ClassDoc>>();
   31.45  
   31.46      /**
   31.47       * Constructor. Build the Tree using the Root of this Javadoc run.
   31.48 @@ -132,7 +132,7 @@
   31.49                  processType(classes[i], configuration, baseclasses, subclasses);
   31.50              } else if (classes[i].isInterface()) {
   31.51                  processInterface(classes[i]);
   31.52 -                List list  = (List)implementingclasses.get(classes[i]);
   31.53 +                List<ClassDoc> list = implementingclasses.get(classes[i]);
   31.54                  if (list != null) {
   31.55                      Collections.sort(list);
   31.56                  }
   31.57 @@ -143,11 +143,11 @@
   31.58          }
   31.59  
   31.60          Collections.sort(baseinterfaces);
   31.61 -        for (Iterator it = subinterfaces.values().iterator(); it.hasNext(); ) {
   31.62 -            Collections.sort((List)it.next());
   31.63 +        for (Iterator<List<ClassDoc>> it = subinterfaces.values().iterator(); it.hasNext(); ) {
   31.64 +            Collections.sort(it.next());
   31.65          }
   31.66 -        for (Iterator it = subclasses.values().iterator(); it.hasNext(); ) {
   31.67 -            Collections.sort((List)it.next());
   31.68 +        for (Iterator<List<ClassDoc>> it = subclasses.values().iterator(); it.hasNext(); ) {
   31.69 +            Collections.sort(it.next());
   31.70          }
   31.71      }
   31.72  
   31.73 @@ -164,7 +164,7 @@
   31.74       * @param configuration the current configurtation of the doclet.
   31.75       */
   31.76      private void processType(ClassDoc cd, Configuration configuration,
   31.77 -            List bases, Map subs) {
   31.78 +            List<ClassDoc> bases, Map<ClassDoc,List<ClassDoc>> subs) {
   31.79          ClassDoc superclass = Util.getFirstVisibleSuperClassCD(cd, configuration);
   31.80          if (superclass != null) {
   31.81              if (!add(subs, superclass, cd)) {
   31.82 @@ -219,10 +219,10 @@
   31.83       * @param cd sub-interface to be mapped.
   31.84       * @returns boolean true if class added, false if class already processed.
   31.85       */
   31.86 -    private boolean add(Map map, ClassDoc superclass, ClassDoc cd) {
   31.87 -        List list = (List)map.get(superclass);
   31.88 +    private boolean add(Map<ClassDoc,List<ClassDoc>> map, ClassDoc superclass, ClassDoc cd) {
   31.89 +        List<ClassDoc> list = map.get(superclass);
   31.90          if (list == null) {
   31.91 -            list = new ArrayList();
   31.92 +            list = new ArrayList<ClassDoc>();
   31.93              map.put(superclass, list);
   31.94          }
   31.95          if (list.contains(cd)) {
   31.96 @@ -241,10 +241,10 @@
   31.97       * @param cd class for which the sub-class list is requested.
   31.98       * @returns List Sub-Class list for the class passed.
   31.99       */
  31.100 -    private List get(Map map, ClassDoc cd) {
  31.101 -        List list = (List)map.get(cd);
  31.102 +    private List<ClassDoc> get(Map<ClassDoc,List<ClassDoc>> map, ClassDoc cd) {
  31.103 +        List<ClassDoc> list = map.get(cd);
  31.104          if (list == null) {
  31.105 -            return new ArrayList();
  31.106 +            return new ArrayList<ClassDoc>();
  31.107          }
  31.108          return list;
  31.109      }
  31.110 @@ -254,7 +254,7 @@
  31.111       *
  31.112       * @param cd class whose sub-class list is required.
  31.113       */
  31.114 -    public List subclasses(ClassDoc cd) {
  31.115 +    public List<ClassDoc> subclasses(ClassDoc cd) {
  31.116          return get(subclasses, cd);
  31.117      }
  31.118  
  31.119 @@ -263,7 +263,7 @@
  31.120       *
  31.121       * @param cd interface whose sub-interface list is required.
  31.122       */
  31.123 -    public List subinterfaces(ClassDoc cd) {
  31.124 +    public List<ClassDoc> subinterfaces(ClassDoc cd) {
  31.125          return get(subinterfaces, cd);
  31.126      }
  31.127  
  31.128 @@ -272,9 +272,9 @@
  31.129       *
  31.130       * @param cd interface whose implementing-classes list is required.
  31.131       */
  31.132 -    public List implementingclasses(ClassDoc cd) {
  31.133 -        List result = get(implementingclasses, cd);
  31.134 -        List subinterfaces = allSubs(cd, false);
  31.135 +    public List<ClassDoc> implementingclasses(ClassDoc cd) {
  31.136 +        List<ClassDoc> result = get(implementingclasses, cd);
  31.137 +        List<ClassDoc> subinterfaces = allSubs(cd, false);
  31.138  
  31.139          //If class x implements a subinterface of cd, then it follows
  31.140          //that class x implements cd.
  31.141 @@ -301,7 +301,7 @@
  31.142       * @param isEnum true if the subclasses should be forced to come from the
  31.143       * enum tree.
  31.144       */
  31.145 -    public List subs(ClassDoc cd, boolean isEnum) {
  31.146 +    public List<ClassDoc> subs(ClassDoc cd, boolean isEnum) {
  31.147          if (isEnum) {
  31.148              return get(subEnums, cd);
  31.149          } else if (cd.isAnnotationType()) {
  31.150 @@ -324,10 +324,10 @@
  31.151       * @param isEnum true if the subclasses should be forced to come from the
  31.152       * enum tree.
  31.153       */
  31.154 -    public List allSubs(ClassDoc cd, boolean isEnum) {
  31.155 -        List list = subs(cd, isEnum);
  31.156 +    public List<ClassDoc> allSubs(ClassDoc cd, boolean isEnum) {
  31.157 +        List<ClassDoc> list = subs(cd, isEnum);
  31.158          for (int i = 0; i < list.size(); i++) {
  31.159 -            cd = (ClassDoc)list.get(i);
  31.160 +            cd = list.get(i);
  31.161              List tlist = subs(cd, isEnum);
  31.162              for (int j = 0; j < tlist.size(); j++) {
  31.163                  ClassDoc tcd = (ClassDoc)tlist.get(j);
    32.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java	Tue Jul 15 09:50:36 2008 -0700
    32.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java	Tue Jul 15 19:22:51 2008 -0700
    32.3 @@ -46,138 +46,138 @@
    32.4       * Mapping of ClassDocs to set of PackageDoc used by that class.
    32.5       * Entries may be null.
    32.6       */
    32.7 -    public Map classToPackage = new HashMap();
    32.8 +    public Map<String,Set<PackageDoc>> classToPackage = new HashMap<String,Set<PackageDoc>>();
    32.9  
   32.10      /**
   32.11       * Mapping of Annotations to set of PackageDoc that use the annotation.
   32.12       */
   32.13 -    public Map classToPackageAnnotations = new HashMap();
   32.14 +    public Map<String,List<PackageDoc>> classToPackageAnnotations = new HashMap<String,List<PackageDoc>>();
   32.15  
   32.16      /**
   32.17       * Mapping of ClassDocs to set of ClassDoc used by that class.
   32.18       * Entries may be null.
   32.19       */
   32.20 -    public Map classToClass = new HashMap();
   32.21 +    public Map<String,Set<ClassDoc>> classToClass = new HashMap<String,Set<ClassDoc>>();
   32.22  
   32.23      /**
   32.24       * Mapping of ClassDocs to list of ClassDoc which are direct or
   32.25       * indirect subclasses of that class.
   32.26       * Entries may be null.
   32.27       */
   32.28 -    public Map classToSubclass = new HashMap();
   32.29 +    public Map<String,List<ClassDoc>> classToSubclass = new HashMap<String,List<ClassDoc>>();
   32.30  
   32.31      /**
   32.32       * Mapping of ClassDocs to list of ClassDoc which are direct or
   32.33       * indirect subinterfaces of that interface.
   32.34       * Entries may be null.
   32.35       */
   32.36 -    public Map classToSubinterface = new HashMap();
   32.37 +    public Map<String,List<ClassDoc>> classToSubinterface = new HashMap<String,List<ClassDoc>>();
   32.38  
   32.39      /**
   32.40       * Mapping of ClassDocs to list of ClassDoc which implement
   32.41       * this interface.
   32.42       * Entries may be null.
   32.43       */
   32.44 -    public Map classToImplementingClass = new HashMap();
   32.45 +    public Map<String,List<ClassDoc>> classToImplementingClass = new HashMap<String,List<ClassDoc>>();
   32.46  
   32.47      /**
   32.48       * Mapping of ClassDocs to list of FieldDoc declared as that class.
   32.49       * Entries may be null.
   32.50       */
   32.51 -    public Map classToField = new HashMap();
   32.52 +    public Map<String,List<FieldDoc>> classToField = new HashMap<String,List<FieldDoc>>();
   32.53  
   32.54      /**
   32.55       * Mapping of ClassDocs to list of MethodDoc returning that class.
   32.56       * Entries may be null.
   32.57       */
   32.58 -    public Map classToMethodReturn = new HashMap();
   32.59 +    public Map<String,List<MethodDoc>> classToMethodReturn = new HashMap<String,List<MethodDoc>>();
   32.60  
   32.61      /**
   32.62       * Mapping of ClassDocs to list of MethodDoc having that class
   32.63       * as an arg.
   32.64       * Entries may be null.
   32.65       */
   32.66 -    public Map classToMethodArgs = new HashMap();
   32.67 +    public Map<String,List<ExecutableMemberDoc>> classToMethodArgs = new HashMap<String,List<ExecutableMemberDoc>>();
   32.68  
   32.69      /**
   32.70       * Mapping of ClassDocs to list of MethodDoc which throws that class.
   32.71       * Entries may be null.
   32.72       */
   32.73 -    public Map classToMethodThrows = new HashMap();
   32.74 +    public Map<String,List<ExecutableMemberDoc>> classToMethodThrows = new HashMap<String,List<ExecutableMemberDoc>>();
   32.75  
   32.76      /**
   32.77       * Mapping of ClassDocs to list of ConstructorDoc having that class
   32.78       * as an arg.
   32.79       * Entries may be null.
   32.80       */
   32.81 -    public Map classToConstructorArgs = new HashMap();
   32.82 +    public Map<String,List<ExecutableMemberDoc>> classToConstructorArgs = new HashMap<String,List<ExecutableMemberDoc>>();
   32.83  
   32.84      /**
   32.85       * Mapping of ClassDocs to list of ConstructorDoc which throws that class.
   32.86       * Entries may be null.
   32.87       */
   32.88 -    public Map classToConstructorThrows = new HashMap();
   32.89 +    public Map<String,List<ExecutableMemberDoc>> classToConstructorThrows = new HashMap<String,List<ExecutableMemberDoc>>();
   32.90  
   32.91      /**
   32.92       * The mapping of AnnotationTypeDocs to constructors that use them.
   32.93       */
   32.94 -    public Map classToConstructorAnnotations = new HashMap();
   32.95 +    public Map<String,List<ConstructorDoc>> classToConstructorAnnotations = new HashMap<String,List<ConstructorDoc>>();
   32.96  
   32.97      /**
   32.98       * The mapping of AnnotationTypeDocs to Constructor parameters that use them.
   32.99       */
  32.100 -    public Map classToConstructorParamAnnotation = new HashMap();
  32.101 +    public Map<String,List<ExecutableMemberDoc>> classToConstructorParamAnnotation = new HashMap<String,List<ExecutableMemberDoc>>();
  32.102  
  32.103      /**
  32.104       * The mapping of ClassDocs to Constructor arguments that use them as type parameters.
  32.105       */
  32.106 -    public Map classToConstructorDocArgTypeParam = new HashMap();
  32.107 +    public Map<String,List<ExecutableMemberDoc>> classToConstructorDocArgTypeParam = new HashMap<String,List<ExecutableMemberDoc>>();
  32.108  
  32.109      /**
  32.110       * The mapping of ClassDocs to ClassDocs that use them as type parameters.
  32.111       */
  32.112 -    public Map classToClassTypeParam = new HashMap();
  32.113 +    public Map<String,List<ClassDoc>> classToClassTypeParam = new HashMap<String,List<ClassDoc>>();
  32.114  
  32.115      /**
  32.116       * The mapping of AnnotationTypeDocs to ClassDocs that use them.
  32.117       */
  32.118 -    public Map classToClassAnnotations = new HashMap();
  32.119 +    public Map<String,List<ClassDoc>> classToClassAnnotations = new HashMap<String,List<ClassDoc>>();
  32.120  
  32.121      /**
  32.122       * The mapping of ClassDocs to ExecutableMemberDocs that use them as type parameters.
  32.123       */
  32.124 -    public Map classToExecMemberDocTypeParam = new HashMap();
  32.125 +    public Map<String,List<MethodDoc>> classToExecMemberDocTypeParam = new HashMap<String,List<MethodDoc>>();
  32.126  
  32.127      /**
  32.128       * The mapping of ClassDocs to ExecutableMemberDocs arguments that use them as type parameters.
  32.129       */
  32.130 -    public Map classToExecMemberDocArgTypeParam = new HashMap();
  32.131 +    public Map<String,List<ExecutableMemberDoc>> classToExecMemberDocArgTypeParam = new HashMap<String,List<ExecutableMemberDoc>>();
  32.132  
  32.133      /**
  32.134       * The mapping of AnnotationTypeDocs to ExecutableMemberDocs that use them.
  32.135       */
  32.136 -    public Map classToExecMemberDocAnnotations = new HashMap();
  32.137 +    public Map<String,List<MethodDoc>> classToExecMemberDocAnnotations = new HashMap<String,List<MethodDoc>>();
  32.138  
  32.139      /**
  32.140       * The mapping of ClassDocs to ExecutableMemberDocs that have return type
  32.141       * with type parameters of that class.
  32.142       */
  32.143 -    public Map classToExecMemberDocReturnTypeParam = new HashMap();
  32.144 +    public Map<String,List<MethodDoc>> classToExecMemberDocReturnTypeParam = new HashMap<String,List<MethodDoc>>();
  32.145  
  32.146      /**
  32.147       * The mapping of AnnotationTypeDocs to MethodDoc parameters that use them.
  32.148       */
  32.149 -    public Map classToExecMemberDocParamAnnotation = new HashMap();
  32.150 +    public Map<String,List<ExecutableMemberDoc>> classToExecMemberDocParamAnnotation = new HashMap<String,List<ExecutableMemberDoc>>();
  32.151  
  32.152      /**
  32.153       * The mapping of ClassDocs to FieldDocs that use them as type parameters.
  32.154       */
  32.155 -    public Map classToFieldDocTypeParam = new HashMap();
  32.156 +    public Map<String,List<FieldDoc>> classToFieldDocTypeParam = new HashMap<String,List<FieldDoc>>();
  32.157  
  32.158      /**
  32.159       * The mapping of AnnotationTypeDocs to FieldDocs that use them.
  32.160       */
  32.161 -    public Map annotationToFieldDoc = new HashMap();
  32.162 +    public Map<String,List<FieldDoc>> annotationToFieldDoc = new HashMap<String,List<FieldDoc>>();
  32.163  
  32.164  
  32.165      public ClassUseMapper(RootDoc root, ClassTree classtree) {
  32.166 @@ -231,15 +231,15 @@
  32.167      /**
  32.168       * Return all subclasses of a class AND fill-in classToSubclass map.
  32.169       */
  32.170 -    private Collection subclasses(ClassDoc cd) {
  32.171 -        Collection ret = (Collection)classToSubclass.get(cd.qualifiedName());
  32.172 +    private Collection<ClassDoc> subclasses(ClassDoc cd) {
  32.173 +        Collection<ClassDoc> ret = classToSubclass.get(cd.qualifiedName());
  32.174          if (ret == null) {
  32.175 -            ret = new TreeSet();
  32.176 -            List subs = classtree.subclasses(cd);
  32.177 +            ret = new TreeSet<ClassDoc>();
  32.178 +            List<ClassDoc> subs = classtree.subclasses(cd);
  32.179              if (subs != null) {
  32.180                  ret.addAll(subs);
  32.181 -                for (Iterator it = subs.iterator(); it.hasNext();) {
  32.182 -                    ret.addAll(subclasses((ClassDoc)it.next()));
  32.183 +                for (Iterator<ClassDoc> it = subs.iterator(); it.hasNext();) {
  32.184 +                    ret.addAll(subclasses(it.next()));
  32.185                  }
  32.186              }
  32.187              addAll(classToSubclass, cd, ret);
  32.188 @@ -250,15 +250,15 @@
  32.189      /**
  32.190       * Return all subinterfaces of an interface AND fill-in classToSubinterface map.
  32.191       */
  32.192 -    private Collection subinterfaces(ClassDoc cd) {
  32.193 -        Collection ret = (Collection)classToSubinterface.get(cd.qualifiedName());
  32.194 +    private Collection<ClassDoc> subinterfaces(ClassDoc cd) {
  32.195 +        Collection<ClassDoc> ret = classToSubinterface.get(cd.qualifiedName());
  32.196          if (ret == null) {
  32.197 -            ret = new TreeSet();
  32.198 -            List subs = classtree.subinterfaces(cd);
  32.199 +            ret = new TreeSet<ClassDoc>();
  32.200 +            List<ClassDoc> subs = classtree.subinterfaces(cd);
  32.201              if (subs != null) {
  32.202                  ret.addAll(subs);
  32.203 -                for (Iterator it = subs.iterator(); it.hasNext();) {
  32.204 -                    ret.addAll(subinterfaces((ClassDoc)it.next()));
  32.205 +                for (Iterator<ClassDoc> it = subs.iterator(); it.hasNext();) {
  32.206 +                    ret.addAll(subinterfaces(it.next()));
  32.207                  }
  32.208              }
  32.209              addAll(classToSubinterface, cd, ret);
  32.210 @@ -272,11 +272,11 @@
  32.211       * implementing subinterfaces) AND fill-in both classToImplementingClass
  32.212       * and classToSubinterface maps.
  32.213       */
  32.214 -    private Collection implementingClasses(ClassDoc cd) {
  32.215 -        Collection ret = (List)classToImplementingClass.get(cd.qualifiedName());
  32.216 +    private Collection<ClassDoc> implementingClasses(ClassDoc cd) {
  32.217 +        Collection<ClassDoc> ret = classToImplementingClass.get(cd.qualifiedName());
  32.218          if (ret == null) {
  32.219 -            ret = new TreeSet();
  32.220 -            List impl = classtree.implementingclasses(cd);
  32.221 +            ret = new TreeSet<ClassDoc>();
  32.222 +            List<ClassDoc> impl = classtree.implementingclasses(cd);
  32.223              if (impl != null) {
  32.224                  ret.addAll(impl);
  32.225                  for (Iterator it = impl.iterator(); it.hasNext();) {
  32.226 @@ -298,7 +298,7 @@
  32.227      private void mapExecutable(ExecutableMemberDoc em) {
  32.228          Parameter[] params = em.parameters();
  32.229          boolean isConstructor = em.isConstructor();
  32.230 -        List classArgs = new ArrayList();
  32.231 +        List<Type> classArgs = new ArrayList<Type>();
  32.232          for (int k = 0; k < params.length; k++) {
  32.233              Type pcd = params[k].type();
  32.234              // primitives don't get mapped, also avoid dups
  32.235 @@ -325,34 +325,38 @@
  32.236          }
  32.237      }
  32.238  
  32.239 -    private List refList(Map map, ClassDoc cd) {
  32.240 -        List list = (List)map.get(cd.qualifiedName());
  32.241 +    private <T> List<T> refList(Map<String,List<T>> map, ClassDoc cd) {
  32.242 +        List<T> list = map.get(cd.qualifiedName());
  32.243          if (list == null) {
  32.244 -            list = new ArrayList();
  32.245 +            @SuppressWarnings("unchecked")
  32.246 +            List<T> l = new ArrayList();
  32.247 +            list = l;
  32.248              map.put(cd.qualifiedName(), list);
  32.249          }
  32.250          return list;
  32.251      }
  32.252  
  32.253 -    private Set packageSet(ClassDoc cd) {
  32.254 -        Set pkgSet = (Set)classToPackage.get(cd.qualifiedName());
  32.255 +    private Set<PackageDoc> packageSet(ClassDoc cd) {
  32.256 +        Set<PackageDoc> pkgSet = classToPackage.get(cd.qualifiedName());
  32.257          if (pkgSet == null) {
  32.258 -            pkgSet = new TreeSet();
  32.259 +            pkgSet = new TreeSet<PackageDoc>();
  32.260              classToPackage.put(cd.qualifiedName(), pkgSet);
  32.261          }
  32.262          return pkgSet;
  32.263      }
  32.264  
  32.265 -    private Set classSet(ClassDoc cd) {
  32.266 -        Set clsSet = (Set)classToClass.get(cd.qualifiedName());
  32.267 +    private Set<ClassDoc> classSet(ClassDoc cd) {
  32.268 +        Set<ClassDoc> clsSet = classToClass.get(cd.qualifiedName());
  32.269          if (clsSet == null) {
  32.270 -            clsSet = new TreeSet();
  32.271 +            @SuppressWarnings("unchecked")
  32.272 +            Set<ClassDoc> s = new TreeSet();
  32.273 +            clsSet = s;
  32.274              classToClass.put(cd.qualifiedName(), clsSet);
  32.275          }
  32.276          return clsSet;
  32.277      }
  32.278  
  32.279 -    private void add(Map map, ClassDoc cd, ProgramElementDoc ref) {
  32.280 +    private <T extends ProgramElementDoc> void add(Map<String,List<T>> map, ClassDoc cd, T ref) {
  32.281          // add to specified map
  32.282          refList(map, cd).add(ref);
  32.283  
  32.284 @@ -361,25 +365,23 @@
  32.285  
  32.286          classSet(cd).add(ref instanceof MemberDoc?
  32.287                  ((MemberDoc)ref).containingClass() :
  32.288 -                    ref);
  32.289 +                    (ClassDoc)ref);
  32.290      }
  32.291  
  32.292 -    private void addAll(Map map, ClassDoc cd, Collection refs) {
  32.293 +    private void addAll(Map<String,List<ClassDoc>> map, ClassDoc cd, Collection<ClassDoc> refs) {
  32.294          if (refs == null) {
  32.295              return;
  32.296          }
  32.297          // add to specified map
  32.298          refList(map, cd).addAll(refs);
  32.299  
  32.300 -        Set pkgSet = packageSet(cd);
  32.301 -        Set clsSet = classSet(cd);
  32.302 +        Set<PackageDoc> pkgSet = packageSet(cd);
  32.303 +        Set<ClassDoc> clsSet = classSet(cd);
  32.304          // add ref's package to package map and class map
  32.305 -        for (Iterator it = refs.iterator(); it.hasNext();) {
  32.306 -            ProgramElementDoc pedoc = (ProgramElementDoc)it.next();
  32.307 -            pkgSet.add(pedoc.containingPackage());
  32.308 -            clsSet.add(pedoc instanceof MemberDoc?
  32.309 -                    ((MemberDoc)pedoc).containingClass() :
  32.310 -                        pedoc);
  32.311 +        for (Iterator<ClassDoc> it = refs.iterator(); it.hasNext();) {
  32.312 +            ClassDoc cls = it.next();
  32.313 +            pkgSet.add(cls.containingPackage());
  32.314 +            clsSet.add(cls);
  32.315  
  32.316          }
  32.317      }
  32.318 @@ -392,8 +394,8 @@
  32.319       * @param doc the doc whose type parameters are being checked.
  32.320       * @param holder the holder that owns the type parameters.
  32.321       */
  32.322 -    private void mapTypeParameters(Map map, Object doc,
  32.323 -            ProgramElementDoc holder) {
  32.324 +    private <T extends ProgramElementDoc> void mapTypeParameters(Map<String,List<T>> map, Object doc,
  32.325 +            T holder) {
  32.326          TypeVariable[] typeVariables;
  32.327          if (doc instanceof ClassDoc) {
  32.328              typeVariables = ((ClassDoc) doc).typeParameters();
  32.329 @@ -438,9 +440,8 @@
  32.330       * @param doc the doc whose type parameters are being checked.
  32.331       * @param holder the holder that owns the type parameters.
  32.332       */
  32.333 -    private void mapAnnotations(Map map, Object doc,
  32.334 -            Object holder) {
  32.335 -        TypeVariable[] typeVariables;
  32.336 +    private <T extends ProgramElementDoc> void mapAnnotations(Map<String,List<T>> map, Object doc,
  32.337 +            T holder) {
  32.338          AnnotationDesc[] annotations;
  32.339          boolean isPackage = false;
  32.340          if (doc instanceof ProgramElementDoc) {
  32.341 @@ -458,12 +459,31 @@
  32.342              if (isPackage)
  32.343                  refList(map, annotationDoc).add(holder);
  32.344              else
  32.345 -                add(map, annotationDoc, (ProgramElementDoc) holder);
  32.346 +                add(map, annotationDoc, holder);
  32.347          }
  32.348      }
  32.349  
  32.350 -    private void addTypeParameterToMap(Map map, Type type,
  32.351 -            ProgramElementDoc holder) {
  32.352 +
  32.353 +    /**
  32.354 +     * Map the AnnotationType to the ProgramElementDocs that use them as
  32.355 +     * type parameters.
  32.356 +     *
  32.357 +     * @param map the map the insert the information into.
  32.358 +     * @param doc the doc whose type parameters are being checked.
  32.359 +     * @param holder the holder that owns the type parameters.
  32.360 +     */
  32.361 +    private <T extends PackageDoc> void mapAnnotations(Map<String,List<T>> map, PackageDoc doc,
  32.362 +            T holder) {
  32.363 +        AnnotationDesc[] annotations;
  32.364 +        annotations = doc.annotations();
  32.365 +        for (int i = 0; i < annotations.length; i++) {
  32.366 +            AnnotationTypeDoc annotationDoc = annotations[i].annotationType();
  32.367 +            refList(map, annotationDoc).add(holder);
  32.368 +        }
  32.369 +    }
  32.370 +
  32.371 +    private <T extends ProgramElementDoc> void addTypeParameterToMap(Map<String,List<T>> map, Type type,
  32.372 +            T holder) {
  32.373          if (type instanceof ClassDoc) {
  32.374              add(map, (ClassDoc) type, holder);
  32.375          } else if (type instanceof ParameterizedType) {
    33.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    33.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    33.3 @@ -52,7 +52,7 @@
    33.4      /**
    33.5       * List of deprecated type Lists.
    33.6       */
    33.7 -    private List deprecatedLists;
    33.8 +    private List<List<Doc>> deprecatedLists;
    33.9  
   33.10  
   33.11      /**
   33.12 @@ -61,9 +61,9 @@
   33.13       * @param root Root of the tree.
   33.14       */
   33.15      public DeprecatedAPIListBuilder(RootDoc root) {
   33.16 -        deprecatedLists = new ArrayList();
   33.17 +        deprecatedLists = new ArrayList<List<Doc>>();
   33.18          for (int i = 0; i < NUM_TYPES; i++) {
   33.19 -            deprecatedLists.add(i, new ArrayList());
   33.20 +            deprecatedLists.add(i, new ArrayList<Doc>());
   33.21          }
   33.22          buildDeprecatedAPIInfo(root);
   33.23      }
   33.24 @@ -114,7 +114,7 @@
   33.25       * @param list List of all the particular deprecated members, e.g. methods.
   33.26       * @param members members to be added in the list.
   33.27       */
   33.28 -    private void composeDeprecatedList(List list, MemberDoc[] members) {
   33.29 +    private void composeDeprecatedList(List<Doc> list, MemberDoc[] members) {
   33.30          for (int i = 0; i < members.length; i++) {
   33.31              if (Util.isDeprecated(members[i])) {
   33.32                  list.add(members[i]);
   33.33 @@ -137,8 +137,8 @@
   33.34       *
   33.35       * @param the constant representing the type of list being returned.
   33.36       */
   33.37 -    public List getList(int type) {
   33.38 -        return (List) deprecatedLists.get(type);
   33.39 +    public List<Doc> getList(int type) {
   33.40 +        return deprecatedLists.get(type);
   33.41      }
   33.42  
   33.43      /**
   33.44 @@ -147,6 +147,6 @@
   33.45       * @param type the type of list being checked.
   33.46       */
   33.47      public boolean hasDocumentation(int type) {
   33.48 -        return ((List) deprecatedLists.get(type)).size() > 0;
   33.49 +        return (deprecatedLists.get(type)).size() > 0;
   33.50      }
   33.51  }
    34.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java	Tue Jul 15 09:50:36 2008 -0700
    34.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java	Tue Jul 15 19:22:51 2008 -0700
    34.3 @@ -164,7 +164,7 @@
    34.4           * subclass of IOException.  This subclass of DocFinder.Output allows
    34.5           * multiple tag inheritence.
    34.6           */
    34.7 -        public List tagList  = new ArrayList();
    34.8 +        public List<Tag> tagList  = new ArrayList<Tag>();
    34.9      }
   34.10  
   34.11      /**
    35.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java	Tue Jul 15 09:50:36 2008 -0700
    35.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java	Tue Jul 15 19:22:51 2008 -0700
    35.3 @@ -53,7 +53,7 @@
    35.4       * Map package names onto Extern Item objects.
    35.5       * Lazily initialized.
    35.6       */
    35.7 -    private Map packageToItemMap;
    35.8 +    private Map<String,Item> packageToItemMap;
    35.9  
   35.10      /**
   35.11       * The global configuration information for this run.
   35.12 @@ -101,7 +101,7 @@
   35.13              this.path = path;
   35.14              this.relative = relative;
   35.15              if (packageToItemMap == null) {
   35.16 -                packageToItemMap = new HashMap();
   35.17 +                packageToItemMap = new HashMap<String,Item>();
   35.18              }
   35.19              if (!packageToItemMap.containsKey(packageName)) { // save the previous
   35.20                  packageToItemMap.put(packageName, this);        // mapped location
   35.21 @@ -185,7 +185,7 @@
   35.22          if (packageToItemMap == null) {
   35.23              return null;
   35.24          }
   35.25 -        return (Item)packageToItemMap.get(pkgName);
   35.26 +        return packageToItemMap.get(pkgName);
   35.27      }
   35.28  
   35.29      /**
    36.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java	Tue Jul 15 09:50:36 2008 -0700
    36.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java	Tue Jul 15 19:22:51 2008 -0700
    36.3 @@ -61,24 +61,24 @@
    36.4      /**
    36.5       * Map of regular expressions with the corresponding group name.
    36.6       */
    36.7 -    private Map regExpGroupMap = new HashMap();
    36.8 +    private Map<String,String> regExpGroupMap = new HashMap<String,String>();
    36.9  
   36.10      /**
   36.11       * List of regular expressions sorted according to the length. Regular
   36.12       * expression with longest length will be first in the sorted order.
   36.13       */
   36.14 -    private List sortedRegExpList = new ArrayList();
   36.15 +    private List<String> sortedRegExpList = new ArrayList<String>();
   36.16  
   36.17      /**
   36.18       * List of group names in the same order as given on the command line.
   36.19       */
   36.20 -    private List groupList = new ArrayList();
   36.21 +    private List<String> groupList = new ArrayList<String>();
   36.22  
   36.23      /**
   36.24       * Map of non-regular expressions(possible package names) with the
   36.25       * corresponding group name.
   36.26       */
   36.27 -    private Map pkgNameGroupMap = new HashMap();
   36.28 +    private Map<String,String> pkgNameGroupMap = new HashMap<String,String>();
   36.29  
   36.30      /**
   36.31       * The global configuration information for this run.
   36.32 @@ -90,9 +90,9 @@
   36.33       * the compare method in the implementing class is doing the reverse
   36.34       * comparison.
   36.35       */
   36.36 -    private static class MapKeyComparator implements Comparator {
   36.37 -        public int compare(Object key1, Object key2) {
   36.38 -            return ((String)key2).length() - ((String)key1).length();
   36.39 +    private static class MapKeyComparator implements Comparator<String> {
   36.40 +        public int compare(String key1, String key2) {
   36.41 +            return key2.length() - key1.length();
   36.42          }
   36.43      }
   36.44  
   36.45 @@ -182,8 +182,8 @@
   36.46       *
   36.47       * @param packages Packages specified on the command line.
   36.48       */
   36.49 -    public Map groupPackages(PackageDoc[] packages) {
   36.50 -        Map groupPackageMap = new HashMap();
   36.51 +    public Map<String,List<PackageDoc>> groupPackages(PackageDoc[] packages) {
   36.52 +        Map<String,List<PackageDoc>> groupPackageMap = new HashMap<String,List<PackageDoc>>();
   36.53          String defaultGroupName =
   36.54              (pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
   36.55                  configuration.message.getText("doclet.Packages") :
   36.56 @@ -195,7 +195,7 @@
   36.57          for (int i = 0; i < packages.length; i++) {
   36.58              PackageDoc pkg = packages[i];
   36.59              String pkgName = pkg.name();
   36.60 -            String groupName = (String)pkgNameGroupMap.get(pkgName);
   36.61 +            String groupName = pkgNameGroupMap.get(pkgName);
   36.62              // if this package is not explicitly assigned to a group,
   36.63              // try matching it to group specified by regular expression
   36.64              if (groupName == null) {
   36.65 @@ -220,9 +220,9 @@
   36.66       */
   36.67      String regExpGroupName(String pkgName) {
   36.68          for (int j = 0; j < sortedRegExpList.size(); j++) {
   36.69 -            String regexp = (String)sortedRegExpList.get(j);
   36.70 +            String regexp = sortedRegExpList.get(j);
   36.71              if (pkgName.startsWith(regexp)) {
   36.72 -                return (String)regExpGroupMap.get(regexp);
   36.73 +                return regExpGroupMap.get(regexp);
   36.74              }
   36.75          }
   36.76          return null;
   36.77 @@ -235,10 +235,10 @@
   36.78       * @param map Map to be searched for gorup name.
   36.79       * @param groupname Group name to search.
   36.80       */
   36.81 -    List getPkgList(Map map, String groupname) {
   36.82 -        List list = (List)map.get(groupname);
   36.83 +    List<PackageDoc> getPkgList(Map<String,List<PackageDoc>> map, String groupname) {
   36.84 +        List<PackageDoc> list = map.get(groupname);
   36.85          if (list == null) {
   36.86 -            list = new ArrayList();
   36.87 +            list = new ArrayList<PackageDoc>();
   36.88              map.put(groupname, list);
   36.89          }
   36.90          return list;
    37.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java	Tue Jul 15 09:50:36 2008 -0700
    37.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java	Tue Jul 15 19:22:51 2008 -0700
    37.3 @@ -41,8 +41,8 @@
    37.4   */
    37.5  public class ImplementedMethods {
    37.6  
    37.7 -    private Map interfaces = new HashMap();
    37.8 -    private List methlist = new ArrayList();
    37.9 +    private Map<MethodDoc,Type> interfaces = new HashMap<MethodDoc,Type>();
   37.10 +    private List<MethodDoc> methlist = new ArrayList<MethodDoc>();
   37.11      private Configuration configuration;
   37.12      private final ClassDoc classdoc;
   37.13      private final MethodDoc method;
   37.14 @@ -67,7 +67,7 @@
   37.15       */
   37.16      public MethodDoc[] build(boolean sort) {
   37.17          buildImplementedMethodList(sort);
   37.18 -        return (MethodDoc[])methlist.toArray(new MethodDoc[methlist.size()]);
   37.19 +        return methlist.toArray(new MethodDoc[methlist.size()]);
   37.20      }
   37.21  
   37.22      public MethodDoc[] build() {
   37.23 @@ -75,7 +75,7 @@
   37.24      }
   37.25  
   37.26      public Type getMethodHolder(MethodDoc methodDoc) {
   37.27 -        return (Type) interfaces.get(methodDoc);
   37.28 +        return interfaces.get(methodDoc);
   37.29      }
   37.30  
   37.31      /**
   37.32 @@ -111,7 +111,7 @@
   37.33          ClassDoc overriddenClass = method.overriddenClass();
   37.34          if (overriddenClass != null) {
   37.35              for (int i = 0; i < methlist.size(); i++) {
   37.36 -                ClassDoc cd = ((MethodDoc)methlist.get(i)).containingClass();
   37.37 +                ClassDoc cd = methlist.get(i).containingClass();
   37.38                  if (cd == overriddenClass || overriddenClass.subclassOf(cd)) {
   37.39                      methlist.remove(i);  // remove overridden method
   37.40                      return;
   37.41 @@ -131,7 +131,7 @@
   37.42      private boolean overridingMethodFound(MethodDoc method) {
   37.43          ClassDoc containingClass = method.containingClass();
   37.44          for (int i = 0; i < methlist.size(); i++) {
   37.45 -            MethodDoc listmethod = (MethodDoc)methlist.get(i);
   37.46 +            MethodDoc listmethod = methlist.get(i);
   37.47              if (containingClass == listmethod.containingClass()) {
   37.48                  // it's the same method.
   37.49                  return true;
    38.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java	Tue Jul 15 09:50:36 2008 -0700
    38.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java	Tue Jul 15 19:22:51 2008 -0700
    38.3 @@ -49,7 +49,7 @@
    38.4       * Mapping of each Unicode Character with the member list containing
    38.5       * members with names starting with it.
    38.6       */
    38.7 -    private Map indexmap = new HashMap();
    38.8 +    private Map<Character,List<Doc>> indexmap = new HashMap<Character,List<Doc>>();
    38.9  
   38.10      /**
   38.11       * Don't generate deprecated information if true.
   38.12 @@ -68,10 +68,10 @@
   38.13       * A comparator used to sort classes and members.
   38.14       * Note:  Maybe this compare code belongs in the tool?
   38.15       */
   38.16 -    private class DocComparator implements Comparator {
   38.17 -        public int compare(Object d1, Object d2) {
   38.18 -            String doc1 = (((Doc) d1).name());
   38.19 -            String doc2 = (((Doc) d2).name());
   38.20 +    private class DocComparator implements Comparator<Doc> {
   38.21 +        public int compare(Doc d1, Doc d2) {
   38.22 +            String doc1 = d1.name();
   38.23 +            String doc2 = d2.name();
   38.24              int compareResult;
   38.25              if ((compareResult = doc1.compareToIgnoreCase(doc2)) != 0) {
   38.26                  return compareResult;
   38.27 @@ -124,8 +124,8 @@
   38.28       * sort each element which is a list.
   38.29       */
   38.30      protected void sortIndexMap() {
   38.31 -        for (Iterator it = indexmap.values().iterator(); it.hasNext(); ) {
   38.32 -            Collections.sort((List)it.next(), new DocComparator());
   38.33 +        for (Iterator<List<Doc>> it = indexmap.values().iterator(); it.hasNext(); ) {
   38.34 +            Collections.sort(it.next(), new DocComparator());
   38.35          }
   38.36      }
   38.37  
   38.38 @@ -141,7 +141,7 @@
   38.39          ClassDoc[] classes = root.classes();
   38.40          if (!classesOnly) {
   38.41              if (packages.length == 0) {
   38.42 -                Set set = new HashSet();
   38.43 +                Set<PackageDoc> set = new HashSet<PackageDoc>();
   38.44                  PackageDoc pd;
   38.45                  for (int i = 0; i < classes.length; i++) {
   38.46                      pd = classes[i].containingPackage();
   38.47 @@ -149,7 +149,7 @@
   38.48                          set.add(pd);
   38.49                      }
   38.50                  }
   38.51 -                adjustIndexMap((PackageDoc[]) set.toArray(packages));
   38.52 +                adjustIndexMap(set.toArray(packages));
   38.53              } else {
   38.54                  adjustIndexMap(packages);
   38.55              }
   38.56 @@ -193,9 +193,9 @@
   38.57                      '*' :
   38.58                      Character.toUpperCase(name.charAt(0));
   38.59                  Character unicode = new Character(ch);
   38.60 -                List list = (List)indexmap.get(unicode);
   38.61 +                List<Doc> list = indexmap.get(unicode);
   38.62                  if (list == null) {
   38.63 -                    list = new ArrayList();
   38.64 +                    list = new ArrayList<Doc>();
   38.65                      indexmap.put(unicode, list);
   38.66                  }
   38.67                  list.add(elements[i]);
    39.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java	Tue Jul 15 09:50:36 2008 -0700
    39.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java	Tue Jul 15 19:22:51 2008 -0700
    39.3 @@ -82,7 +82,7 @@
    39.4       * definitions are on separate pages.
    39.5       */
    39.6      public String[] getMetaKeywords(ClassDoc classdoc) {
    39.7 -        ArrayList results = new ArrayList();
    39.8 +        ArrayList<String> results = new ArrayList<String>();
    39.9  
   39.10          // Add field and method keywords only if -keywords option is used
   39.11          if( configuration.keywords ) {
   39.12 @@ -90,16 +90,16 @@
   39.13              results.addAll(getMemberKeywords(classdoc.fields()));
   39.14              results.addAll(getMemberKeywords(classdoc.methods()));
   39.15          }
   39.16 -        return (String[]) results.toArray(new String[]{});
   39.17 +        return results.toArray(new String[]{});
   39.18      }
   39.19  
   39.20      /**
   39.21       * Get the current class for a meta tag keyword, as the first
   39.22       * and only element of an array list.
   39.23       */
   39.24 -    protected ArrayList getClassKeyword(ClassDoc classdoc) {
   39.25 +    protected ArrayList<String> getClassKeyword(ClassDoc classdoc) {
   39.26          String cltypelower = classdoc.isInterface() ? "interface" : "class";
   39.27 -        ArrayList metakeywords = new ArrayList(1);
   39.28 +        ArrayList<String> metakeywords = new ArrayList<String>(1);
   39.29          metakeywords.add(classdoc.qualifiedName() + " " + cltypelower);
   39.30          return metakeywords;
   39.31      }
   39.32 @@ -141,8 +141,8 @@
   39.33       *
   39.34       * @param memberdocs  array of MemberDoc objects to be added to keywords
   39.35       */
   39.36 -    protected ArrayList getMemberKeywords(MemberDoc[] memberdocs) {
   39.37 -        ArrayList results = new ArrayList();
   39.38 +    protected ArrayList<String> getMemberKeywords(MemberDoc[] memberdocs) {
   39.39 +        ArrayList<String> results = new ArrayList<String>();
   39.40          String membername;
   39.41          for (int i=0; i < memberdocs.length; i++) {
   39.42              membername = memberdocs[i].name()
    40.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java	Tue Jul 15 09:50:36 2008 -0700
    40.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java	Tue Jul 15 19:22:51 2008 -0700
    40.3 @@ -260,12 +260,12 @@
    40.4       * @param docs the array of <code>Doc</code>s to add anchors for.
    40.5       * @param hash the <code>HashMap</code> to add to.
    40.6       */
    40.7 -    protected static void addToHash(Doc[] docs, HashMap hash) {
    40.8 +    protected static void addToHash(Doc[] docs, HashMap<Integer,String> hash) {
    40.9          if(docs == null) {
   40.10              return;
   40.11          }
   40.12          for(int i = 0; i < docs.length; i++) {
   40.13 -            hash.put(new Integer(docs[i].position().line()), getAnchor(docs[i]));
   40.14 +            hash.put(docs[i].position().line(), getAnchor(docs[i]));
   40.15          }
   40.16      }
   40.17  
    41.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Tue Jul 15 09:50:36 2008 -0700
    41.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Tue Jul 15 19:22:51 2008 -0700
    41.3 @@ -73,9 +73,9 @@
    41.4       * @return List       List of eligible members for whom
    41.5       *                    documentation is getting generated.
    41.6       */
    41.7 -    public static List excludeDeprecatedMembersAsList(
    41.8 +    public static List<ProgramElementDoc> excludeDeprecatedMembersAsList(
    41.9          ProgramElementDoc[] members) {
   41.10 -        List list = new ArrayList();
   41.11 +        List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>();
   41.12          for (int i = 0; i < members.length; i++) {
   41.13              if (members[i].tags("deprecated").length == 0) {
   41.14                  list.add(members[i]);
   41.15 @@ -372,10 +372,10 @@
   41.16       * We want the list of types in alphabetical order.  However, types are not
   41.17       * comparable.  We need a comparator for now.
   41.18       */
   41.19 -    private static class TypeComparator implements Comparator {
   41.20 -        public int compare(Object type1, Object type2) {
   41.21 -            return ((Type) type1).qualifiedTypeName().toLowerCase().compareTo(
   41.22 -                ((Type) type2).qualifiedTypeName().toLowerCase());
   41.23 +    private static class TypeComparator implements Comparator<Type> {
   41.24 +        public int compare(Type type1, Type type2) {
   41.25 +            return type1.qualifiedTypeName().toLowerCase().compareTo(
   41.26 +                type2.qualifiedTypeName().toLowerCase());
   41.27          }
   41.28      }
   41.29  
   41.30 @@ -391,9 +391,9 @@
   41.31       * @param  sort if true, return list of interfaces sorted alphabetically.
   41.32       * @return List of all the required interfaces.
   41.33       */
   41.34 -    public static List getAllInterfaces(Type type,
   41.35 +    public static List<Type> getAllInterfaces(Type type,
   41.36              Configuration configuration, boolean sort) {
   41.37 -        Map results = sort ? new TreeMap() : new LinkedHashMap();
   41.38 +        Map<ClassDoc,Type> results = sort ? new TreeMap<ClassDoc,Type>() : new LinkedHashMap<ClassDoc,Type>();
   41.39          Type[] interfaceTypes = null;
   41.40          Type superType = null;
   41.41          if (type instanceof ParameterizedType) {
   41.42 @@ -423,7 +423,7 @@
   41.43              }
   41.44          }
   41.45          if (superType == null)
   41.46 -            return new ArrayList(results.values());
   41.47 +            return new ArrayList<Type>(results.values());
   41.48          //Try walking the tree.
   41.49          addAllInterfaceTypes(results,
   41.50              superType,
   41.51 @@ -431,7 +431,7 @@
   41.52                  ((ClassDoc) superType).interfaceTypes() :
   41.53                  ((ParameterizedType) superType).interfaceTypes(),
   41.54              false, configuration);
   41.55 -        List resultsList = new ArrayList(results.values());
   41.56 +        List<Type> resultsList = new ArrayList<Type>(results.values());
   41.57          if (sort) {
   41.58                  Collections.sort(resultsList, new TypeComparator());
   41.59          }
   41.60 @@ -442,7 +442,7 @@
   41.61          return getAllInterfaces(type, configuration, true);
   41.62      }
   41.63  
   41.64 -    private static void findAllInterfaceTypes(Map results, ClassDoc c, boolean raw,
   41.65 +    private static void findAllInterfaceTypes(Map<ClassDoc,Type> results, ClassDoc c, boolean raw,
   41.66              Configuration configuration) {
   41.67          Type superType = c.superclassType();
   41.68          if (superType == null)
   41.69 @@ -454,7 +454,7 @@
   41.70                  raw, configuration);
   41.71      }
   41.72  
   41.73 -    private static void findAllInterfaceTypes(Map results, ParameterizedType p,
   41.74 +    private static void findAllInterfaceTypes(Map<ClassDoc,Type> results, ParameterizedType p,
   41.75              Configuration configuration) {
   41.76          Type superType = p.superclassType();
   41.77          if (superType == null)
   41.78 @@ -466,7 +466,7 @@
   41.79                  false, configuration);
   41.80      }
   41.81  
   41.82 -    private static void addAllInterfaceTypes(Map results, Type type,
   41.83 +    private static void addAllInterfaceTypes(Map<ClassDoc,Type> results, Type type,
   41.84              Type[] interfaceTypes, boolean raw,
   41.85              Configuration configuration) {
   41.86          for (int i = 0; i < interfaceTypes.length; i++) {
   41.87 @@ -495,8 +495,8 @@
   41.88      }
   41.89  
   41.90  
   41.91 -    public static List asList(ProgramElementDoc[] members) {
   41.92 -        List list = new ArrayList();
   41.93 +    public static List<ProgramElementDoc> asList(ProgramElementDoc[] members) {
   41.94 +        List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>();
   41.95          for (int i = 0; i < members.length; i++) {
   41.96              list.add(members[i]);
   41.97          }
   41.98 @@ -639,7 +639,7 @@
   41.99       * @return an array of tokens.
  41.100       */
  41.101      public static String[] tokenize(String s, char separator, int maxTokens) {
  41.102 -        List tokens = new ArrayList();
  41.103 +        List<String> tokens = new ArrayList<String>();
  41.104          StringBuilder  token = new StringBuilder ();
  41.105          boolean prevIsEscapeChar = false;
  41.106          for (int i = 0; i < s.length(); i += Character.charCount(i)) {
  41.107 @@ -663,7 +663,7 @@
  41.108          if (token.length() > 0) {
  41.109              tokens.add(token.toString());
  41.110          }
  41.111 -        return (String[]) tokens.toArray(new String[] {});
  41.112 +        return tokens.toArray(new String[] {});
  41.113      }
  41.114  
  41.115      /**
    42.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java	Tue Jul 15 09:50:36 2008 -0700
    42.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java	Tue Jul 15 19:22:51 2008 -0700
    42.3 @@ -65,19 +65,19 @@
    42.4      /**
    42.5       * List of ClassDoc objects for which ClassMembers objects are built.
    42.6       */
    42.7 -    private final List visibleClasses = new ArrayList();
    42.8 +    private final List<ClassDoc> visibleClasses = new ArrayList<ClassDoc>();
    42.9  
   42.10      /**
   42.11       * Map for each member name on to a map which contains members with same
   42.12       * name-signature. The mapped map will contain mapping for each MemberDoc
   42.13       * onto it's respecive level string.
   42.14       */
   42.15 -    private final Map memberNameMap = new HashMap();
   42.16 +    private final Map<Object,Map<ProgramElementDoc,String>> memberNameMap = new HashMap<Object,Map<ProgramElementDoc,String>>();
   42.17  
   42.18      /**
   42.19       * Map of class and it's ClassMembers object.
   42.20       */
   42.21 -    private final Map classMap = new HashMap();
   42.22 +    private final Map<ClassDoc,ClassMembers> classMap = new HashMap<ClassDoc,ClassMembers>();
   42.23  
   42.24      /**
   42.25       * Type whose visible members are requested.  This is the leaf of
   42.26 @@ -128,8 +128,8 @@
   42.27       * @param configuation the current configuration of the doclet.
   42.28       * @return the package private members inherited by the class.
   42.29       */
   42.30 -    private List getInheritedPackagePrivateMethods(Configuration configuration) {
   42.31 -        List results = new ArrayList();
   42.32 +    private List<ProgramElementDoc> getInheritedPackagePrivateMethods(Configuration configuration) {
   42.33 +        List<ProgramElementDoc> results = new ArrayList<ProgramElementDoc>();
   42.34          for (Iterator iter = visibleClasses.iterator(); iter.hasNext(); ) {
   42.35              ClassDoc currentClass = (ClassDoc) iter.next();
   42.36              if (currentClass != classdoc &&
   42.37 @@ -150,8 +150,8 @@
   42.38       *
   42.39       * @param configuation the current configuration of the doclet.
   42.40       */
   42.41 -    public List getLeafClassMembers(Configuration configuration) {
   42.42 -        List result = getMembersFor(classdoc);
   42.43 +    public List<ProgramElementDoc> getLeafClassMembers(Configuration configuration) {
   42.44 +        List<ProgramElementDoc> result = getMembersFor(classdoc);
   42.45          result.addAll(getInheritedPackagePrivateMethods(configuration));
   42.46          return result;
   42.47      }
   42.48 @@ -163,10 +163,10 @@
   42.49       *
   42.50       * @return the list of members for the given class.
   42.51       */
   42.52 -    public List getMembersFor(ClassDoc cd) {
   42.53 -        ClassMembers clmembers = (ClassMembers)(classMap.get(cd));
   42.54 +    public List<ProgramElementDoc> getMembersFor(ClassDoc cd) {
   42.55 +        ClassMembers clmembers = classMap.get(cd);
   42.56          if (clmembers == null) {
   42.57 -            return new ArrayList();
   42.58 +            return new ArrayList<ProgramElementDoc>();
   42.59          }
   42.60          return clmembers.getMembers();
   42.61      }
   42.62 @@ -175,11 +175,11 @@
   42.63       * Sort the given mixed list of classes and interfaces to a list of
   42.64       * classes followed by interfaces traversed. Don't sort alphabetically.
   42.65       */
   42.66 -    private void sort(List list) {
   42.67 -        List classes = new ArrayList();
   42.68 -        List interfaces = new ArrayList();
   42.69 +    private void sort(List<ClassDoc> list) {
   42.70 +        List<ClassDoc> classes = new ArrayList<ClassDoc>();
   42.71 +        List<ClassDoc> interfaces = new ArrayList<ClassDoc>();
   42.72          for (int i = 0; i < list.size(); i++) {
   42.73 -            ClassDoc cd = (ClassDoc)list.get(i);
   42.74 +            ClassDoc cd = list.get(i);
   42.75              if (cd.isClass()) {
   42.76                  classes.add(cd);
   42.77              } else {
   42.78 @@ -191,12 +191,12 @@
   42.79          list.addAll(interfaces);
   42.80      }
   42.81  
   42.82 -    private void fillMemberLevelMap(List list, String level) {
   42.83 +    private void fillMemberLevelMap(List<ProgramElementDoc> list, String level) {
   42.84          for (int i = 0; i < list.size(); i++) {
   42.85 -            Object key = getMemberKey((ProgramElementDoc)list.get(i));
   42.86 -            Map memberLevelMap = (Map) memberNameMap.get(key);
   42.87 +            Object key = getMemberKey(list.get(i));
   42.88 +            Map<ProgramElementDoc,String> memberLevelMap = memberNameMap.get(key);
   42.89              if (memberLevelMap == null) {
   42.90 -                memberLevelMap = new HashMap();
   42.91 +                memberLevelMap = new HashMap<ProgramElementDoc,String>();
   42.92                  memberNameMap.put(key, memberLevelMap);
   42.93              }
   42.94              memberLevelMap.put(list.get(i), level);
   42.95 @@ -218,10 +218,10 @@
   42.96       * type variables in consideration when comparing.
   42.97       */
   42.98      private class ClassMember {
   42.99 -        private Set members;
  42.100 +        private Set<ProgramElementDoc> members;
  42.101  
  42.102          public ClassMember(ProgramElementDoc programElementDoc) {
  42.103 -            members = new HashSet();
  42.104 +            members = new HashSet<ProgramElementDoc>();
  42.105              members.add(programElementDoc);
  42.106          }
  42.107  
  42.108 @@ -256,7 +256,7 @@
  42.109          /**
  42.110           * List of inherited members from the mapping class.
  42.111           */
  42.112 -        private List members = new ArrayList();
  42.113 +        private List<ProgramElementDoc> members = new ArrayList<ProgramElementDoc>();
  42.114  
  42.115          /**
  42.116           * Level/Depth of inheritance.
  42.117 @@ -268,7 +268,7 @@
  42.118           *
  42.119           * @return List Inherited members.
  42.120           */
  42.121 -        public List getMembers() {
  42.122 +        public List<ProgramElementDoc> getMembers() {
  42.123              return members;
  42.124          }
  42.125  
  42.126 @@ -276,11 +276,11 @@
  42.127              this.mappingClass = mappingClass;
  42.128              this.level = level;
  42.129              if (classMap.containsKey(mappingClass) &&
  42.130 -                        level.startsWith(((ClassMembers) classMap.get(mappingClass)).level)) {
  42.131 +                        level.startsWith(classMap.get(mappingClass).level)) {
  42.132                  //Remove lower level class so that it can be replaced with
  42.133                  //same class found at higher level.
  42.134                  purgeMemberLevelMap(getClassMembers(mappingClass, false),
  42.135 -                    ((ClassMembers) classMap.get(mappingClass)).level);
  42.136 +                    classMap.get(mappingClass).level);
  42.137                  classMap.remove(mappingClass);
  42.138                  visibleClasses.remove(mappingClass);
  42.139              }
  42.140 @@ -326,11 +326,10 @@
  42.141           * Adjust member-level-map, class-map.
  42.142           */
  42.143          private void addMembers(ClassDoc fromClass) {
  42.144 -            List cdmembers = getClassMembers(fromClass, true);
  42.145 -            List incllist = new ArrayList();
  42.146 +            List<ProgramElementDoc> cdmembers = getClassMembers(fromClass, true);
  42.147 +            List<ProgramElementDoc> incllist = new ArrayList<ProgramElementDoc>();
  42.148              for (int i = 0; i < cdmembers.size(); i++) {
  42.149 -                ProgramElementDoc pgmelem =
  42.150 -                    (ProgramElementDoc)(cdmembers.get(i));
  42.151 +                ProgramElementDoc pgmelem = cdmembers.get(i);
  42.152                  if (!found(members, pgmelem) &&
  42.153                      memberIsVisible(pgmelem) &&
  42.154                      !isOverridden(pgmelem, level)) {
  42.155 @@ -373,7 +372,7 @@
  42.156          /**
  42.157           * Return all available class members.
  42.158           */
  42.159 -        private List getClassMembers(ClassDoc cd, boolean filter) {
  42.160 +        private List<ProgramElementDoc> getClassMembers(ClassDoc cd, boolean filter) {
  42.161              if (cd.isEnum() && kind == CONSTRUCTORS) {
  42.162                  //If any of these rules are hit, return empty array because
  42.163                  //we don't document these members ever.
  42.164 @@ -428,16 +427,15 @@
  42.165           */
  42.166          private AnnotationTypeElementDoc[] filter(AnnotationTypeDoc doc,
  42.167              boolean required) {
  42.168 -            AnnotationTypeElementDoc[] members = ((AnnotationTypeDoc) doc).elements();
  42.169 -            List targetMembers = new ArrayList();
  42.170 +            AnnotationTypeElementDoc[] members = doc.elements();
  42.171 +            List<AnnotationTypeElementDoc> targetMembers = new ArrayList<AnnotationTypeElementDoc>();
  42.172              for (int i = 0; i < members.length; i++) {
  42.173                  if ((required && members[i].defaultValue() == null) ||
  42.174                       ((!required) && members[i].defaultValue() != null)){
  42.175                      targetMembers.add(members[i]);
  42.176                  }
  42.177              }
  42.178 -            return (AnnotationTypeElementDoc[])
  42.179 -                targetMembers.toArray(new AnnotationTypeElementDoc[]{});
  42.180 +            return targetMembers.toArray(new AnnotationTypeElementDoc[]{});
  42.181          }
  42.182  
  42.183          private boolean found(List list, ProgramElementDoc elem) {
    43.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java	Tue Jul 15 09:50:36 2008 -0700
    43.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java	Tue Jul 15 19:22:51 2008 -0700
    43.3 @@ -84,7 +84,7 @@
    43.4                          owner instanceof ClassDoc) {
    43.5                      linkInfo.classDoc = (ClassDoc) owner;
    43.6                      linkInfo.label = type.typeName();
    43.7 -                    linkOutput.append(getClassLink((LinkInfo) linkInfo));
    43.8 +                    linkOutput.append(getClassLink(linkInfo));
    43.9                  } else {
   43.10                      //No need to link method type parameters.
   43.11                      linkInfo.displayLength += type.typeName().length();
   43.12 @@ -113,7 +113,7 @@
   43.13                      return linkOutput;
   43.14                  } else {
   43.15                      linkInfo.classDoc = type.asClassDoc();
   43.16 -                    linkOutput = getClassLink((LinkInfo) linkInfo);
   43.17 +                    linkOutput = getClassLink(linkInfo);
   43.18                      if (linkInfo.includeTypeAsSepLink) {
   43.19                          linkOutput.append(getTypeParameterLinks(linkInfo, false));
   43.20                      }
   43.21 @@ -136,7 +136,7 @@
   43.22              return linkOutput;
   43.23          } else if (linkInfo.classDoc != null) {
   43.24              //Just a class link
   43.25 -            LinkOutput linkOutput = getClassLink((LinkInfo) linkInfo);
   43.26 +            LinkOutput linkOutput = getClassLink(linkInfo);
   43.27              if (linkInfo.includeTypeAsSepLink) {
   43.28                  linkOutput.append(getTypeParameterLinks(linkInfo, false));
   43.29              }
    44.1 --- a/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java	Tue Jul 15 09:50:36 2008 -0700
    44.2 +++ b/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java	Tue Jul 15 19:22:51 2008 -0700
    44.3 @@ -47,7 +47,7 @@
    44.4   */
    44.5  public class DocletInvoker {
    44.6  
    44.7 -    private final Class docletClass;
    44.8 +    private final Class<?> docletClass;
    44.9  
   44.10      private final String docletClassName;
   44.11  
    45.1 --- a/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java	Tue Jul 15 09:50:36 2008 -0700
    45.2 +++ b/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java	Tue Jul 15 19:22:51 2008 -0700
    45.3 @@ -231,7 +231,7 @@
    45.4          StringBuffer result = new StringBuffer();
    45.5          result.append("(");
    45.6          for (List<Type> types = sym.type.getParameterTypes(); types.nonEmpty(); ) {
    45.7 -            Type t = (Type)types.head;
    45.8 +            Type t = types.head;
    45.9              result.append(TypeMaker.getTypeString(env, t, full));
   45.10              types = types.tail;
   45.11              if (types.nonEmpty()) {
    46.1 --- a/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java	Tue Jul 15 09:50:36 2008 -0700
    46.2 +++ b/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java	Tue Jul 15 19:22:51 2008 -0700
    46.3 @@ -86,7 +86,7 @@
    46.4          if (tree.sym != null && tree.sym.kind == Kinds.TYP) {
    46.5              if (tree.sym == null) return;
    46.6              String comment = env.toplevel.docComments.get(tree);
    46.7 -            ClassSymbol c = (ClassSymbol)tree.sym;
    46.8 +            ClassSymbol c = tree.sym;
    46.9              docenv.makeClassDoc(c, comment, tree, env.toplevel.lineMap);
   46.10          }
   46.11      }
    47.1 --- a/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java	Tue Jul 15 09:50:36 2008 -0700
    47.2 +++ b/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java	Tue Jul 15 19:22:51 2008 -0700
    47.3 @@ -63,7 +63,7 @@
    47.4  
    47.5      public void visitMethodDef(JCMethodDecl tree) {
    47.6          super.visitMethodDef(tree);
    47.7 -        MethodSymbol meth = (MethodSymbol)tree.sym;
    47.8 +        MethodSymbol meth = tree.sym;
    47.9          if (meth == null || meth.kind != Kinds.MTH) return;
   47.10          String docComment = env.toplevel.docComments.get(tree);
   47.11          Position.LineMap lineMap = env.toplevel.lineMap;
   47.12 @@ -82,7 +82,7 @@
   47.13                  !isParameter(tree.sym)) {
   47.14              String docComment = env.toplevel.docComments.get(tree);
   47.15              Position.LineMap lineMap = env.toplevel.lineMap;
   47.16 -            docenv.makeFieldDoc((VarSymbol)tree.sym, docComment, tree, lineMap);
   47.17 +            docenv.makeFieldDoc(tree.sym, docComment, tree, lineMap);
   47.18          }
   47.19      }
   47.20  
    48.1 --- a/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java	Tue Jul 15 09:50:36 2008 -0700
    48.2 +++ b/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java	Tue Jul 15 19:22:51 2008 -0700
    48.3 @@ -450,7 +450,7 @@
    48.4              if (typeId.length() > 0) {
    48.5                  paramList.append(typeId.toString());
    48.6              }
    48.7 -            return (String[])paramList.toArray(new String[paramList.length()]);
    48.8 +            return paramList.toArray(new String[paramList.length()]);
    48.9          }
   48.10  
   48.11          void addTypeToParamList() {
    49.1 --- a/src/share/classes/com/sun/tools/javadoc/SerializedForm.java	Tue Jul 15 09:50:36 2008 -0700
    49.2 +++ b/src/share/classes/com/sun/tools/javadoc/SerializedForm.java	Tue Jul 15 19:22:51 2008 -0700
    49.3 @@ -267,7 +267,7 @@
    49.4       * @return an array of MethodDocImpl for serialization methods in this class.
    49.5       */
    49.6      MethodDoc[] methods() {
    49.7 -        return (MethodDoc[])methods.toArray(new MethodDoc[methods.length()]);
    49.8 +        return methods.toArray(new MethodDoc[methods.length()]);
    49.9      }
   49.10  
   49.11      /**
    50.1 --- a/src/share/classes/com/sun/tools/javah/Gen.java	Tue Jul 15 09:50:36 2008 -0700
    50.2 +++ b/src/share/classes/com/sun/tools/javah/Gen.java	Tue Jul 15 19:22:51 2008 -0700
    50.3 @@ -324,7 +324,7 @@
    50.4  
    50.5      FieldDoc[] getAllFields(ClassDoc subclazz)
    50.6                  throws ClassNotFoundException {
    50.7 -        Vector fields = new Vector();
    50.8 +        Vector<FieldDoc> fields = new Vector<FieldDoc>();
    50.9          ClassDoc cd = null;
   50.10          Stack s = new Stack();
   50.11  

mercurial